<span style="color: rgb(0, 0, 0); font-weight: bold; "><?php</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">class</span> cmGn <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> <a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a> <span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span> <span style="color: rgb(51, 153, 51); ">===</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">return</span> <a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(51, 153, 51); ">!</span><a href="http://www.php.net/is_callable"><span style="color: rgb(153, 0, 0); ">is_callable</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmGnException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Provided predicate is not a callable function.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$count</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(51, 153, 51); ">===</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">true</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(0, 0, 136); ">$count</span><span style="color: rgb(51, 153, 51); ">++;</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 0, 136); ">$count</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> where<span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a> <span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(51, 153, 51); ">!</span><a href="http://www.php.net/is_callable"><span style="color: rgb(153, 0, 0); ">is_callable</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmGnException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Provided predicate is not a callable function.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$newAr</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(51, 153, 51); ">===</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">true</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(0, 153, 0); ">[</span><span style="color: rgb(0, 153, 0); ">]</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> select<span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a> <span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(51, 153, 51); ">!</span><a href="http://www.php.net/is_callable"><span style="color: rgb(153, 0, 0); ">is_callable</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmGnException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Provided predicate is not a callable function.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$newAr</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(0, 153, 0); ">[</span><span style="color: rgb(0, 153, 0); ">]</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> selectMany<span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a> <span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(51, 153, 51); ">!</span><a href="http://www.php.net/is_callable"><span style="color: rgb(153, 0, 0); ">is_callable</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmGnException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Provided predicate is not a callable function.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$newAr</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$newItem</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(0, 153, 0); ">[</span><span style="color: rgb(0, 153, 0); ">]</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$newItem</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> first<span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a> <span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(51, 153, 51); ">!</span><a href="http://www.php.net/is_callable"><span style="color: rgb(153, 0, 0); ">is_callable</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmGnException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Provided predicate is not a callable function.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(51, 153, 51); ">===</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">true</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmGnException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'No items were found in the array parameter to return as the first item in a cmGn predicate query.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> firstOrNull<span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a> <span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(51, 153, 51); ">!</span><a href="http://www.php.net/is_callable"><span style="color: rgb(153, 0, 0); ">is_callable</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmGnException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Provided predicate is not a callable function.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(51, 153, 51); ">===</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">true</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> last<span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a> <span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">return</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">first</span><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array_reverse"><span style="color: rgb(153, 0, 0); ">array_reverse</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> lastOrNull<span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a> <span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">return</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">firstOrNull</span><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array_reverse"><span style="color: rgb(153, 0, 0); ">array_reverse</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$predicate</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">class</span> cmTest <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">private</span> <span style="color: rgb(0, 0, 136); ">$testCount</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">private</span> <span style="color: rgb(0, 0, 136); ">$passCount</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> alert<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(177, 177, 0); ">echo</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'<p style="margin:0;padding:0">'</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 0, 255); ">'</p>'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testAssertFailed<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">alert</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Assert failed failed.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>Exception <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(102, 102, 102); font-style: italic; ">// The test passed if we got here.</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testAssertAreEqual<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>Exception <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testAssertAreEqual2<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>Exception <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(102, 102, 102); font-style: italic; ">// The test passed if we got here.</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testAssertAreNotEqual<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areNotEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>Exception <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testAssertAreNotEqual2<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areNotEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>Exception <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(102, 102, 102); font-style: italic; ">// The test passed if we got here.</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testAssertIsTrue<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">isTrue</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); font-weight: bold; ">true</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>Exception <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testAssertIsFalse<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">isFalse</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); font-weight: bold; ">false</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>Exception <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testCmGnWhere<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span>
<span style="color: rgb(204, 102, 204); ">4</span><span style="color: rgb(51, 153, 51); ">,</span>
<a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span>cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">where</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$v'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return $v < 2;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span>cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">where</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$v'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return $v == 3;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testCmGnCount<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span>
<span style="color: rgb(204, 102, 204); ">4</span><span style="color: rgb(51, 153, 51); ">,</span>
cmGn<span style="color: rgb(51, 153, 51); ">::</span><a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$v'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return $v < 2;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span>
<span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span>
cmGn<span style="color: rgb(51, 153, 51); ">::</span><a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$v'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return $v == 3;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testCmGnSelect<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$newAr</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">select</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$v'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return $v - 1;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$item</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">isTrue</span><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/in_array"><span style="color: rgb(153, 0, 0); ">in_array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$item</span> <span style="color: rgb(51, 153, 51); ">-</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">true</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testCmGnSelectMany<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$newAr</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">selectMany</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return $a;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$v'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return $v === 3;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$v'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return $v === 1;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">12</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$newAr</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testCmGnFirst<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$first</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">first</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return count($a) == 3;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$first</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">isTrue</span><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/in_array"><span style="color: rgb(153, 0, 0); ">in_array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$first</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$first</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">first</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return count($a) == 4;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>cmGnException <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(102, 102, 102); font-style: italic; ">// The test passed if we got here.</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testCmGnFirstOrNull<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$first</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">firstOrNull</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return count($a) == 3;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$first</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">isTrue</span><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/in_array"><span style="color: rgb(153, 0, 0); ">in_array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$first</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$first</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">firstOrNull</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return count($a) == 4;'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$first</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testCmGnLast<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">4</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$last</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">last</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return in_array(3, $a);'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">isTrue</span><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/in_array"><span style="color: rgb(153, 0, 0); ">in_array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">4</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$last</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$last</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">last</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return in_array(5, $a);'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">failed</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>cmGnException <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(102, 102, 102); font-style: italic; ">// The test passed if we got here.</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">protected</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> testCmGnLastOrNull<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$array</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(204, 102, 204); ">4</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$last</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">lastOrNull</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return in_array(3, $a);'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">isTrue</span><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/in_array"><span style="color: rgb(153, 0, 0); ">in_array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(204, 102, 204); ">4</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$last</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$last</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">lastOrNull</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$array</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$a'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return in_array(5, $a);'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
cmAssert<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">areEqual</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$last</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> test<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">alert</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Starting tests...'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$methd</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/get_class_methods"><span style="color: rgb(153, 0, 0); ">get_class_methods</span></a><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/get_class"><span style="color: rgb(153, 0, 0); ">get_class</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$methd</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$methd</span> ? <span style="color: rgb(0, 0, 136); ">$methd</span> <span style="color: rgb(51, 153, 51); ">:</span> <a href="http://www.php.net/array"><span style="color: rgb(153, 0, 0); ">Array</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$tests</span> <span style="color: rgb(51, 153, 51); ">=</span> cmGn<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">where</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$methd</span><span style="color: rgb(51, 153, 51); ">,</span> <a href="http://www.php.net/create_function"><span style="color: rgb(153, 0, 0); ">create_function</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'$m'</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'return cmTest::isTest($m);'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">alert</span><span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/count"><span style="color: rgb(153, 0, 0); ">count</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$tests</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 0, 255); ">' tests found.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">foreach</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$tests</span> <span style="color: rgb(177, 177, 0); ">as</span> <span style="color: rgb(0, 0, 136); ">$test</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(0, 153, 0); ">{</span>
try <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">alert</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Performing '</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 0, 136); ">$test</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 0, 255); ">'...'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">testCount</span><span style="color: rgb(51, 153, 51); ">++;</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 0, 136); ">$test</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">passCount</span><span style="color: rgb(51, 153, 51); ">++;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
catch <span style="color: rgb(0, 153, 0); ">(</span>Exception <span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">alert</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$e</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">getMessage</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">alert</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">passCount</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 0, 255); ">' of '</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 0, 136); ">$this</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">testCount</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 0, 255); ">' tests passed.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> isTest<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$test</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$strpos</span> <span style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/strpos"><span style="color: rgb(153, 0, 0); ">strpos</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$test</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 255); ">'test'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$strpos</span> <span style="color: rgb(51, 153, 51); ">===</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">false</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">false</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$strpos</span> <span style="color: rgb(51, 153, 51); ">></span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">false</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$test</span> <span style="color: rgb(51, 153, 51); ">==</span> <span style="color: rgb(0, 0, 255); ">'test'</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">false</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">return</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">true</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">class</span> cmAssert <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> failed<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$message</span> ? <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">:</span> <span style="color: rgb(0, 0, 255); ">'Assert failed called.'</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmTestException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> areEqual<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$val1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$val2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$message</span> ? <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">:</span> <span style="color: rgb(0, 0, 255); ">'Assert are equal failed.'</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$val1</span> <span style="color: rgb(51, 153, 51); ">!==</span> <span style="color: rgb(0, 0, 136); ">$val2</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmTestException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">2</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> areNotEqual<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$val1</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$val2</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$message</span> ? <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">:</span> <span style="color: rgb(0, 0, 255); ">'Assert are not equal failed.'</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$val1</span> <span style="color: rgb(51, 153, 51); ">===</span> <span style="color: rgb(0, 0, 136); ">$val2</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmTestException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">3</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> isTrue<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$boolean</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$message</span> ? <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">:</span> <span style="color: rgb(0, 0, 255); ">'Assert is true failed.'</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$boolean</span> <span style="color: rgb(51, 153, 51); ">!==</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">true</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmTestException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">4</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> static <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> isFalse<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$boolean</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 136); ">$message</span> ? <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">:</span> <span style="color: rgb(0, 0, 255); ">'Assert is false failed.'</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(177, 177, 0); ">if</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$boolean</span> <span style="color: rgb(51, 153, 51); ">!==</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">false</span><span style="color: rgb(0, 153, 0); ">)</span>
<span style="color: rgb(177, 177, 0); ">throw</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmTestException<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">5</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">class</span> cmException <span style="color: rgb(0, 0, 0); font-weight: bold; ">extends</span> Exception <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">const</span> baseCode <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">1064000</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> __construct<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$code</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
parent<span style="color: rgb(51, 153, 51); ">::</span>__construct<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'phpChimpanzee Exception: '</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span> ? <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">:</span> <span style="color: rgb(0, 0, 255); ">'No message given.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span>
cmException<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">baseCode</span> <span style="color: rgb(51, 153, 51); ">+</span> <span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/abs"><span style="color: rgb(153, 0, 0); ">abs</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$code</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(51, 153, 51); ">*</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">class</span> cmTestException <span style="color: rgb(0, 0, 0); font-weight: bold; ">extends</span> cmException <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">const</span> baseCodeModifier <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">64000</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> __construct<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$code</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
parent<span style="color: rgb(51, 153, 51); ">::</span>__construct<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 255); ">'Test failure... '</span> <span style="color: rgb(51, 153, 51); ">.</span> <span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span> ? <span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">:</span> <span style="color: rgb(0, 0, 255); ">'No message given.'</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">,</span>
cmTestException<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">baseCodeModifier</span> <span style="color: rgb(51, 153, 51); ">+</span> <span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/abs"><span style="color: rgb(153, 0, 0); ">abs</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$code</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(51, 153, 51); ">*</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">class</span> cmGnException <span style="color: rgb(0, 0, 0); font-weight: bold; ">extends</span> cmException <span style="color: rgb(0, 153, 0); ">{</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">const</span> baseCodeModifier <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">128000</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">public</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">function</span> __construct<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 153, 0); font-weight: bold; ">null</span><span style="color: rgb(51, 153, 51); ">,</span> <span style="color: rgb(0, 0, 136); ">$code</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(204, 102, 204); ">0</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(0, 153, 0); ">{</span>
parent<span style="color: rgb(51, 153, 51); ">::</span>__construct<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$message</span><span style="color: rgb(51, 153, 51); ">,</span>
cmGnException<span style="color: rgb(51, 153, 51); ">::</span><span style="color: rgb(0, 64, 0); ">baseCodeModifier</span> <span style="color: rgb(51, 153, 51); ">+</span> <span style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/abs"><span style="color: rgb(153, 0, 0); ">abs</span></a><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 0, 136); ">$code</span><span style="color: rgb(0, 153, 0); ">)</span> <span style="color: rgb(51, 153, 51); ">*</span> <span style="color: rgb(51, 153, 51); ">-</span><span style="color: rgb(204, 102, 204); ">1</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 153, 0); ">}</span>
<span style="color: rgb(0, 0, 136); ">$test</span> <span style="color: rgb(51, 153, 51); ">=</span> <span style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> cmTest<span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 136); ">$test</span><span style="color: rgb(51, 153, 51); ">-></span><span style="color: rgb(0, 64, 0); ">test</span><span style="color: rgb(0, 153, 0); ">(</span><span style="color: rgb(0, 153, 0); ">)</span><span style="color: rgb(51, 153, 51); ">;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold; ">?></span>