3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cosas = array( 'true' => TRUE, 'false' => FALSE, 'null' => NULL, 'empty' => "", 'positive' => 1, 'negative' => -1, 'zero' => 0 ); foreach($cosas as $nombre => $cosa) { echo "<h3>$nombre</h3>"; echo "<ul>"; echo "<li><strong>isset: </strong>" . isset($cosa) . "</li>"; echo "<li><strong>is_null: </strong>" . is_null($cosa) . "</li>"; echo "<li><strong>empty: </strong>" . empty($cosa) . "</li>"; echo "</ul>"; }
based on j0Ogq
Output for 4.3.0 - 7.1.7, 7.2.0
<h3>true</h3><ul><li><strong>isset: </strong>1</li><li><strong>is_null: </strong></li><li><strong>empty: </strong></li></ul><h3>false</h3><ul><li><strong>isset: </strong>1</li><li><strong>is_null: </strong></li><li><strong>empty: </strong>1</li></ul><h3>null</h3><ul><li><strong>isset: </strong></li><li><strong>is_null: </strong>1</li><li><strong>empty: </strong>1</li></ul><h3>empty</h3><ul><li><strong>isset: </strong>1</li><li><strong>is_null: </strong></li><li><strong>empty: </strong>1</li></ul><h3>positive</h3><ul><li><strong>isset: </strong>1</li><li><strong>is_null: </strong></li><li><strong>empty: </strong></li></ul><h3>negative</h3><ul><li><strong>isset: </strong>1</li><li><strong>is_null: </strong></li><li><strong>empty: </strong></li></ul><h3>zero</h3><ul><li><strong>isset: </strong>1</li><li><strong>is_null: </strong></li><li><strong>empty: </strong>1</li></ul>
Output for 7.1.10

Process exited with code 137.