3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Point { } class Dimension { } class Rectangle { } $items = array(true, false, null, 23, 0, -26, 4.21, 0.0, -3.76, 'hello', '', array(1, 2, 3), array('', '', ''), array(), new stdClass(), new Point(), new Dimension(), new Rectangle()); echo '<table cellpadding="4" border="1"> <tr> <th>syntax</th> <th>value</th> <th>type</th> <th>empty</th> <th>boolean</th> </tr>' . "\n"; foreach($items AS $item) { $booleanValue = (boolean)$item; $empty = (empty($item) ? 'EMPTY' : '&nbsp;'); $type = gettype($item); $syntax = 'if((boolean)'; $val; if($type == boolean) { $val = ($booleanValue ? 'true' : 'false'); $syntax .= ($val . ')'); } else if($type == 'NULL') { $val = 'null'; $syntax .= 'null)'; } else if($type == double && !$booleanValue) { $val = '0.0'; $syntax .= '0.0)'; } else if($type == string) { $val = '\'' . $item . '\''; $syntax .= ($val . ')'); } else if($type == 'array') { $val = $item; $syntax .= '$array)'; } else if($type == 'object') { $val = get_class($item); $syntax .= ('$' . strtolower($val) . ')'); } else { $val = $item; $syntax .= ($val . ')'); } echo ' <tr style="color: ' . ($booleanValue ? '#006600' : '#880000') . ';"> <td><code>' . $syntax . '</code></td> <td>' . $val . '</td> <td>' . $type . '</td> <td>' . $empty . '</td> <td>' . ($booleanValue ? 'TRUE' : 'FALSE') . '</td> </tr>' . "\n"; } echo '</table>' . "\n"; ?>
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
<table cellpadding="4" border="1"> <tr> <th>syntax</th> <th>value</th> <th>type</th> <th>empty</th> <th>boolean</th> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #006600;"> <td><code>if((boolean)true)</code></td> <td>true</td> <td>boolean</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)false)</code></td> <td>false</td> <td>boolean</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)null)</code></td> <td>null</td> <td>NULL</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)23)</code></td> <td>23</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)0)</code></td> <td>0</td> <td>integer</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-26)</code></td> <td>-26</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)4.21)</code></td> <td>4.21</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 <tr style="color: #880000;"> <td><code>if((boolean)0.0)</code></td> <td>0.0</td> <td>double</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-3.76)</code></td> <td>-3.76</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)'hello')</code></td> <td>'hello'</td> <td>string</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)'')</code></td> <td>''</td> <td>string</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 Notice: Array to string conversion in /in/JN5UK on line 66 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 Notice: Array to string conversion in /in/JN5UK on line 66 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 Notice: Array to string conversion in /in/JN5UK on line 66 <tr style="color: #880000;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$stdclass)</code></td> <td>stdClass</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$point)</code></td> <td>Point</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$dimension)</code></td> <td>Dimension</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$rectangle)</code></td> <td>Rectangle</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> </table>
Output for hhvm-3.10.0 - 3.12.0
<table cellpadding="4" border="1"> <tr> <th>syntax</th> <th>value</th> <th>type</th> <th>empty</th> <th>boolean</th> </tr> Notice: Undefined variable: val in /in/JN5UK on line 26 Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #006600;"> <td><code>if((boolean)true)</code></td> <td>true</td> <td>boolean</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)false)</code></td> <td>false</td> <td>boolean</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)null)</code></td> <td>null</td> <td>NULL</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)23)</code></td> <td>23</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)0)</code></td> <td>0</td> <td>integer</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-26)</code></td> <td>-26</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)4.21)</code></td> <td>4.21</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> <tr style="color: #880000;"> <td><code>if((boolean)0.0)</code></td> <td>0.0</td> <td>double</td> <td>EMPTY</td> <td>FALSE</td> </tr> <tr style="color: #006600;"> <td><code>if((boolean)-3.76)</code></td> <td>-3.76</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> <tr style="color: #006600;"> <td><code>if((boolean)'hello')</code></td> <td>'hello'</td> <td>string</td> <td>&nbsp;</td> <td>TRUE</td> </tr> <tr style="color: #880000;"> <td><code>if((boolean)'')</code></td> <td>''</td> <td>string</td> <td>EMPTY</td> <td>FALSE</td> </tr> <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> <tr style="color: #880000;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>EMPTY</td> <td>FALSE</td> </tr> <tr style="color: #006600;"> <td><code>if((boolean)$stdclass)</code></td> <td>stdClass</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> <tr style="color: #006600;"> <td><code>if((boolean)$point)</code></td> <td>Point</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> <tr style="color: #006600;"> <td><code>if((boolean)$dimension)</code></td> <td>Dimension</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> <tr style="color: #006600;"> <td><code>if((boolean)$rectangle)</code></td> <td>Rectangle</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> </table>
Output for 5.1.0 - 5.3.29
<table cellpadding="4" border="1"> <tr> <th>syntax</th> <th>value</th> <th>type</th> <th>empty</th> <th>boolean</th> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #006600;"> <td><code>if((boolean)true)</code></td> <td>true</td> <td>boolean</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)false)</code></td> <td>false</td> <td>boolean</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)null)</code></td> <td>null</td> <td>NULL</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)23)</code></td> <td>23</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)0)</code></td> <td>0</td> <td>integer</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-26)</code></td> <td>-26</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)4.21)</code></td> <td>4.21</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 <tr style="color: #880000;"> <td><code>if((boolean)0.0)</code></td> <td>0.0</td> <td>double</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-3.76)</code></td> <td>-3.76</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)'hello')</code></td> <td>'hello'</td> <td>string</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)'')</code></td> <td>''</td> <td>string</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$stdclass)</code></td> <td>stdClass</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$point)</code></td> <td>Point</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$dimension)</code></td> <td>Dimension</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$rectangle)</code></td> <td>Rectangle</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> </table>
Output for 5.0.4 - 5.0.5
<table cellpadding="4" border="1"> <tr> <th>syntax</th> <th>value</th> <th>type</th> <th>empty</th> <th>boolean</th> </tr> Notice: Undefined variable: val in /in/JN5UK on line 26 Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #006600;"> <td><code>if((boolean)true)</code></td> <td>true</td> <td>boolean</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)false)</code></td> <td>false</td> <td>boolean</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)null)</code></td> <td>null</td> <td>NULL</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)23)</code></td> <td>23</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)0)</code></td> <td>0</td> <td>integer</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-26)</code></td> <td>-26</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)4.21)</code></td> <td>4.21</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 <tr style="color: #880000;"> <td><code>if((boolean)0.0)</code></td> <td>0.0</td> <td>double</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-3.76)</code></td> <td>-3.76</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)'hello')</code></td> <td>'hello'</td> <td>string</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)'')</code></td> <td>''</td> <td>string</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$stdclass)</code></td> <td>stdClass</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$point)</code></td> <td>Point</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$dimension)</code></td> <td>Dimension</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$rectangle)</code></td> <td>Rectangle</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> </table>
Output for 5.0.0 - 5.0.3
<table cellpadding="4" border="1"> <tr> <th>syntax</th> <th>value</th> <th>type</th> <th>empty</th> <th>boolean</th> </tr> Notice: Undefined variable: val in /in/JN5UK on line 26 Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #006600;"> <td><code>if((boolean)true)</code></td> <td>true</td> <td>boolean</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)false)</code></td> <td>false</td> <td>boolean</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)null)</code></td> <td>null</td> <td>NULL</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)23)</code></td> <td>23</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)0)</code></td> <td>0</td> <td>integer</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-26)</code></td> <td>-26</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)4.21)</code></td> <td>4.21</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 <tr style="color: #880000;"> <td><code>if((boolean)0.0)</code></td> <td>0.0</td> <td>double</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-3.76)</code></td> <td>-3.76</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)'hello')</code></td> <td>'hello'</td> <td>string</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)'')</code></td> <td>''</td> <td>string</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$stdclass)</code></td> <td>stdClass</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$point)</code></td> <td>Point</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$dimension)</code></td> <td>Dimension</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$rectangle)</code></td> <td>Rectangle</td> <td>object</td> <td>&nbsp;</td> <td>TRUE</td> </tr> </table>
Output for 4.3.0 - 4.4.9
<table cellpadding="4" border="1"> <tr> <th>syntax</th> <th>value</th> <th>type</th> <th>empty</th> <th>boolean</th> </tr> Notice: Undefined variable: val in /in/JN5UK on line 26 Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #006600;"> <td><code>if((boolean)true)</code></td> <td>true</td> <td>boolean</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)false)</code></td> <td>false</td> <td>boolean</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 <tr style="color: #880000;"> <td><code>if((boolean)null)</code></td> <td>null</td> <td>NULL</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)23)</code></td> <td>23</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)0)</code></td> <td>0</td> <td>integer</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-26)</code></td> <td>-26</td> <td>integer</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)4.21)</code></td> <td>4.21</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 <tr style="color: #880000;"> <td><code>if((boolean)0.0)</code></td> <td>0.0</td> <td>double</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)-3.76)</code></td> <td>-3.76</td> <td>double</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)'hello')</code></td> <td>'hello'</td> <td>string</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)'')</code></td> <td>''</td> <td>string</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #006600;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>&nbsp;</td> <td>TRUE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)$array)</code></td> <td>Array</td> <td>array</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)$stdclass)</code></td> <td>stdClass</td> <td>object</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)$point)</code></td> <td>point</td> <td>object</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)$dimension)</code></td> <td>dimension</td> <td>object</td> <td>EMPTY</td> <td>FALSE</td> </tr> Notice: Use of undefined constant boolean - assumed 'boolean' in /in/JN5UK on line 28 Notice: Use of undefined constant double - assumed 'double' in /in/JN5UK on line 38 Notice: Use of undefined constant string - assumed 'string' in /in/JN5UK on line 43 <tr style="color: #880000;"> <td><code>if((boolean)$rectangle)</code></td> <td>rectangle</td> <td>object</td> <td>EMPTY</td> <td>FALSE</td> </tr> </table>