3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php foreach([true, 1, '1', 'a', [1], (object)[]] as $val) echo var_export($val, true) . ' == true is ' . ($val == true ? 'true' : 'false') . PHP_EOL;

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
true == true is true 1 == true is true '1' == true is true 'a' == true is true array ( 0 => 1, ) == true is true stdClass::__set_state(array( )) == true is true
Output for Arrow functions
true == true is true 1 == true is true '1' == true is true 'a' == true is true array ( 0 => 1, ) == true is true stdClass::__set_state(array( )) == true is true
Output for Object typehint
true == true is true 1 == true is true '1' == true is true 'a' == true is true array ( 0 => 1, ) == true is true stdClass::__set_state(array( )) == true is true
Output for Array change keys
true == true is true 1 == true is true '1' == true is true 'a' == true is true array ( 0 => 1, ) == true is true stdClass::__set_state(array( )) == true is true
Output for Lexical anon
true == true is true 1 == true is true '1' == true is true 'a' == true is true array ( 0 => 1, ) == true is true stdClass::__set_state(array( )) == true is true

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page