3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php header('Content-Type: text/plain'); function test($a, $b) { echo var_export($a, 1) . ' == ' . var_export($b, 1) . ' => ' . var_export($a == $b, 1) . "\n"; } test( null, '' ); // true test( null, array() ); // true test( '', array() ); // false test( 'true', true ); // true test( 'false', false ); // false test( 'false', true ); // true test( 9, '09' ); // true test( 9, 09 ); // false test( '0E4', 09 ); // true test( '0x00', '0E4' ); // true test( '0x0.1', 0 ); // true test( 'x', 0 ); // true test( '0xabcabcabcabcabc', '0XABCABCABCABCABd' ); // true test( array('1'), array('0x1') ); // true test( array(1) + array(2), array(1) ); // true test( function(){}, new stdclass() ); // true test( `foo`, `bar` ); // true
Output for hhvm-3.12.0
NULL == '' => true NULL == array ( ) => true '' == array ( ) => false 'true' == true => true 'false' == false => false 'false' == true => true 9 == '09' => true 9 == 0 => false '0E4' == 0 => true '0x00' == '0E4' => true '0x0.1' == 0 => true 'x' == 0 => true '0xabcabcabcabcabc' == '0XABCABCABCABCABd' => false array ( 0 => '1', ) == array ( 0 => '0x1', ) => true array ( 0 => 1, ) == array ( 0 => 1, ) => true 'Closure$test;642009848$b728f763640d3f18ee6fd1ece866b000$' == stdClass::__set_state(array( )) => false 'Failed to exec: `foo\' ' == 'Failed to exec: `bar\' ' => false
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.43 - 5.6.28
NULL == '' => true NULL == array ( ) => true '' == array ( ) => false 'true' == true => true 'false' == false => false 'false' == true => true 9 == '09' => true 9 == 0 => false '0E4' == 0 => true '0x00' == '0E4' => true '0x0.1' == 0 => true 'x' == 0 => true '0xabcabcabcabcabc' == '0XABCABCABCABCABd' => false array ( 0 => '1', ) == array ( 0 => '0x1', ) => true array ( 0 => 1, ) == array ( 0 => 1, ) => true Closure::__set_state(array( )) == stdClass::__set_state(array( )) => false NULL == NULL => true
Output for 5.3.18 - 5.3.29, 5.4.8 - 5.4.42
NULL == '' => true NULL == array ( ) => true '' == array ( ) => false 'true' == true => true 'false' == false => false 'false' == true => true 9 == '09' => true 9 == 0 => false '0E4' == 0 => true '0x00' == '0E4' => true '0x0.1' == 0 => true 'x' == 0 => true '0xabcabcabcabcabc' == '0XABCABCABCABCABd' => false array ( 0 => '1', ) == array ( 0 => '0x1', ) => true array ( 0 => 1, ) == array ( 0 => 1, ) => true Closure::__set_state(array( )) == stdClass::__set_state(array( )) => false NULL == NULL => true sh: 1: foo: not found sh: 1: bar: not found
Output for 5.3.0 - 5.3.17, 5.4.0 - 5.4.7
NULL == '' => true NULL == array ( ) => true '' == array ( ) => false 'true' == true => true 'false' == false => false 'false' == true => true 9 == '09' => true 9 == 0 => false '0E4' == 0 => true '0x00' == '0E4' => true '0x0.1' == 0 => true 'x' == 0 => true '0xabcabcabcabcabc' == '0XABCABCABCABCABd' => false array ( 0 => '1', ) == array ( 0 => '0x1', ) => true array ( 0 => 1, ) == array ( 0 => 1, ) => true Notice: Object of class Closure could not be converted to int in /in/Lbb3K on line 4 Notice: Object of class stdClass could not be converted to int in /in/Lbb3K on line 4 Closure::__set_state(array( )) == stdClass::__set_state(array( )) => true NULL == NULL => true sh: 1: foo: not found sh: 1: bar: not found
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/Lbb3K on line 22
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/Lbb3K on line 22
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/Lbb3K on line 22
Process exited with code 255.