3v4l.org

run code in 300+ PHP versions simultaneously
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output for 8.3.0 - 8.3.19, 8.4.1 - 8.4.5
Testing with null (with casting) ================================================>> ------------------------>> (without casting) Warning: foreach() argument must be of type array|object, null given in /in/aO76k on line 42 Testing with false (with casting) ================================================>> 0 => ------------------------>> (without casting) Warning: foreach() argument must be of type array|object, false given in /in/aO76k on line 42 Testing with true (with casting) ================================================>> 0 => 1 ------------------------>> (without casting) Warning: foreach() argument must be of type array|object, true given in /in/aO76k on line 42 Testing with class (with casting) ================================================>> propertyOne => propertyOneValue propertyThree => propertyThreeValue foreachTestprivateProperty => privateProperty ------------------------>> (without casting) propertyOne => propertyOneValue propertyThree => propertyThreeValue Testing with array (with casting) ================================================>> key_1 => val_1 key_2 => val_2 ------------------------>> (without casting) key_1 => val_1 key_2 => val_2 Testing with undefined (with casting) ================================================>> Warning: Undefined variable $undefined in /in/aO76k on line 34 ------------------------>> (without casting) Warning: Undefined variable $undefined in /in/aO76k on line 42 Warning: foreach() argument must be of type array|object, null given in /in/aO76k on line 42
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.32, 8.2.0 - 8.2.28
Testing with null (with casting) ================================================>> ------------------------>> (without casting) Warning: foreach() argument must be of type array|object, null given in /in/aO76k on line 42 Testing with false (with casting) ================================================>> 0 => ------------------------>> (without casting) Warning: foreach() argument must be of type array|object, bool given in /in/aO76k on line 42 Testing with true (with casting) ================================================>> 0 => 1 ------------------------>> (without casting) Warning: foreach() argument must be of type array|object, bool given in /in/aO76k on line 42 Testing with class (with casting) ================================================>> propertyOne => propertyOneValue propertyThree => propertyThreeValue foreachTestprivateProperty => privateProperty ------------------------>> (without casting) propertyOne => propertyOneValue propertyThree => propertyThreeValue Testing with array (with casting) ================================================>> key_1 => val_1 key_2 => val_2 ------------------------>> (without casting) key_1 => val_1 key_2 => val_2 Testing with undefined (with casting) ================================================>> Warning: Undefined variable $undefined in /in/aO76k on line 34 ------------------------>> (without casting) Warning: Undefined variable $undefined in /in/aO76k on line 42 Warning: foreach() argument must be of type array|object, null given in /in/aO76k on line 42
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Testing with null (with casting) ================================================>> ------------------------>> (without casting) Warning: Invalid argument supplied for foreach() in /in/aO76k on line 42 Testing with false (with casting) ================================================>> 0 => ------------------------>> (without casting) Warning: Invalid argument supplied for foreach() in /in/aO76k on line 42 Testing with true (with casting) ================================================>> 0 => 1 ------------------------>> (without casting) Warning: Invalid argument supplied for foreach() in /in/aO76k on line 42 Testing with class (with casting) ================================================>> propertyOne => propertyOneValue propertyThree => propertyThreeValue foreachTestprivateProperty => privateProperty ------------------------>> (without casting) propertyOne => propertyOneValue propertyThree => propertyThreeValue Testing with array (with casting) ================================================>> key_1 => val_1 key_2 => val_2 ------------------------>> (without casting) key_1 => val_1 key_2 => val_2 Testing with undefined (with casting) ================================================>> Notice: Undefined variable: undefined in /in/aO76k on line 34 ------------------------>> (without casting) Notice: Undefined variable: undefined in /in/aO76k on line 42 Warning: Invalid argument supplied for foreach() in /in/aO76k on line 42
Output for 7.3.32 - 7.3.33
Testing with null (with casting) ================================================>> ------------------------>> (without casting) Warning: Invalid argument supplied for foreach() in /in/aO76k on line 42 Testing with false (with casting) ================================================>> 0 => ------------------------>> (without casting) Warning: Invalid argument supplied for foreach() in /in/aO76k on line 42 Testing with true (with casting) ================================================>> 0 => 1 ------------------------>> (without casting) Warning: Invalid argument supplied for foreach() in /in/aO76k on line 42 Testing with class (with casting) ================================================>> propertyOne => propertyOneValue propertyThree => propertyThreeValue foreachTestprivateProperty => privateProperty ------------------------>> (without casting) propertyOne => propertyOneValue propertyThree => propertyThreeValue Testing with array (with casting) ================================================>> key_1 => val_1 key_2 => val_2 ------------------------>> (without casting) key_1 => val_1 key_2 => val_2 Testing with undefined (with casting) ================================================>> ------------------------>> (without casting) Warning: Invalid argument supplied for foreach() in /in/aO76k on line 42
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/aO76k on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/aO76k on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/aO76k on line 8
Process exited with code 255.

preferences:
169.25 ms | 424 KiB | 5 Q