3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class World { public $greeting; public $rand; // no value private $priv; public function __construct() { $this->greeting = 'Hello'; } } $w = new World(); $wr = (array) $w; list($greet_exists, $greet_isset_o, $greet_isset_a, $greet_a_e,$greet_empty) = [ json_encode(property_exists($w,'greeting')), json_encode(isset($w->greeting)), json_encode(isset($wr['greeting'])), json_encode(array_key_exists('greeting', $wr)), json_encode(empty($w->greeting)) ]; echo "Greeting: {$wr['greeting']}; Exists: $greet_exists; Is prop set: $greet_isset_o; Is index set: $greet_isset_a; Array index: $greet_a_e; Empty: $greet_empty".PHP_EOL; list($rand_exists,$rand_isset_o,$rand_isset_a,$rand_a_e,$rand_empty) = [ json_encode(property_exists($w,'rand')),json_encode(isset($w->rand)), json_encode(isset($wr['rand'])),json_encode(array_key_exists('rand', $wr)), json_encode(empty($w->rand)) ]; echo "Random: {$wr['rand']}; Exists: $rand_exists; Is prop set: $rand_isset_o; Is index set: $rand_isset_a; Array index: $rand_a_e; Empty: $rand_empty".PHP_EOL; list($priv_exists,$priv_isset_o,$priv_isset_a,$priv_a_e,$priv_empty) = [ json_encode(property_exists($w,'priv')),json_encode(isset($w->priv)), json_encode(isset($wr['priv'])),json_encode(array_key_exists('priv', $wr)), json_encode(empty($w->priv)) ]; echo "Private: {$wr['priv']}; Exists: $priv_exists; Is prop set: $priv_isset_o; Is index set: $priv_isset_a; Array index: $priv_a_e; Empty: $priv_empty".PHP_EOL;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.130.0050.00517.89
8.4.120.0110.01020.42
8.4.110.0130.00718.13
8.4.100.0140.00618.83
8.4.90.0110.00619.02
8.4.80.0040.00417.93
8.4.70.0070.00118.11
8.4.60.0100.00920.81
8.4.50.0120.00820.49
8.4.40.0070.01319.69
8.4.30.0080.00017.73
8.4.20.0070.00319.56
8.4.10.0050.00517.95
8.3.250.0130.00619.00
8.3.240.0080.00316.79
8.3.230.0120.00716.77
8.3.220.0080.01017.29
8.3.210.0130.00917.04
8.3.200.0030.00516.68
8.3.190.0110.00417.32
8.3.180.0080.00316.80
8.3.170.0180.00019.02
8.3.160.0120.00318.60
8.3.150.0120.00620.84
8.3.140.0030.00516.96
8.3.130.0100.01018.72
8.3.120.0110.00720.71
8.3.110.0060.00316.63
8.3.100.0140.00724.06
8.3.90.0070.01126.77
8.3.80.0060.00318.56
8.3.70.0150.00817.00
8.3.60.0140.00416.63
8.3.50.0160.00517.61
8.3.40.0000.01418.95
8.3.30.0040.01119.02
8.3.20.0000.00819.14
8.3.10.0100.00021.66
8.3.00.0050.00323.36
8.2.290.0120.00720.50
8.2.280.0060.00218.52
8.2.270.0090.00917.36
8.2.260.0120.00618.45
8.2.250.0120.00016.83
8.2.240.0070.01317.42
8.2.230.0040.00420.94
8.2.220.0030.00637.54
8.2.210.0000.00826.77
8.2.200.0060.00316.75
8.2.190.0140.00716.74
8.2.180.0110.00725.92
8.2.170.0130.00618.96
8.2.160.0090.00618.97
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0050.00320.94
8.2.110.0000.00921.04
8.2.100.0040.00718.16
8.2.90.0000.00919.17
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0000.00817.75
8.2.50.0030.00618.05
8.2.40.0040.00418.16
8.2.30.0040.00419.26
8.2.20.0000.00818.14
8.2.10.0070.00019.37
8.2.00.0000.00719.49
8.1.330.0090.00922.07
8.1.320.0100.00916.34
8.1.310.0070.01018.35
8.1.300.0000.00917.81
8.1.290.0000.00930.84
8.1.280.0040.01125.92
8.1.270.0040.00420.25
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0130.00020.72
8.1.230.0060.00620.16
8.1.220.0000.00917.74
8.1.210.0030.00518.77
8.1.200.0050.00517.35
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0090.00017.65
8.1.160.0000.00718.85
8.1.150.0000.00718.80
8.1.140.0000.00719.48
8.1.130.0040.00419.16
8.1.120.0000.00717.54
8.1.110.0030.00617.53
8.1.100.0030.00517.39
8.1.90.0000.00717.46
8.1.80.0070.00017.46
8.1.70.0070.00017.45
8.1.60.0060.00317.51
8.1.50.0040.00417.54
8.1.40.0000.00817.46
8.1.30.0000.00817.74
8.1.20.0000.00817.66
8.1.10.0040.00417.58
8.1.00.0030.00517.48
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0070.00018.41
8.0.270.0000.00717.31
8.0.260.0030.00317.21
8.0.250.0070.00017.03
8.0.240.0070.00216.92
8.0.230.0060.00317.06
8.0.220.0000.00716.94
8.0.210.0000.00716.93
8.0.200.0000.00616.95
8.0.190.0030.00516.95
8.0.180.0000.00817.04
8.0.170.0030.00617.05
8.0.160.0080.00017.02
8.0.150.0030.00316.89
8.0.140.0070.00016.89
8.0.130.0030.00313.42
8.0.120.0000.00816.82
8.0.110.0000.00717.04
8.0.100.0000.00817.06
8.0.90.0000.00816.80
8.0.80.0050.01516.96
8.0.70.0030.00517.07
8.0.60.0000.00716.95
8.0.50.0040.00416.98
8.0.30.0110.01017.24
8.0.20.0130.00617.40
8.0.10.0080.00017.19
8.0.00.0130.00716.83
7.4.330.0000.00415.55
7.4.320.0030.00316.64
7.4.300.0030.00316.52
7.4.290.0030.00316.63
7.4.280.0040.00416.71
7.4.270.0090.00016.57
7.4.260.0000.00716.54
7.4.250.0040.00416.62
7.4.240.0000.00716.64
7.4.230.0000.00816.59
7.4.220.0050.00516.40
7.4.210.0080.00716.54
7.4.200.0080.00016.58
7.4.160.0050.01216.52
7.4.140.0110.00717.86
7.4.130.0040.01316.59
7.4.120.0130.00716.59
7.4.110.0130.00316.64
7.4.100.0060.01016.64
7.4.90.0050.01116.46
7.4.80.0120.00919.39
7.4.70.0090.00616.40
7.4.60.0080.00816.57
7.4.50.0110.00016.55
7.4.40.0100.01316.50
7.4.00.0120.00314.74
7.3.330.0080.00013.47
7.3.320.0060.00013.46
7.3.310.0000.00716.44
7.3.300.0030.00316.47
7.3.290.0030.00416.42
7.3.280.0100.00416.46
7.3.260.0090.00916.50
7.3.240.0130.00816.56
7.3.230.0090.01316.50
7.3.210.0180.00416.74
7.3.200.0060.01216.48
7.3.190.0120.00416.73
7.3.180.0080.01116.59
7.3.170.0060.01216.54
7.3.160.0070.01016.53
7.3.10.0150.00016.82
7.3.00.0000.00916.48
7.2.330.0100.01416.44
7.2.320.0120.00916.79
7.2.310.0120.00816.52
7.2.300.0150.00316.45
7.2.290.0110.01116.62
7.2.130.0060.00616.75
7.2.120.0030.00616.95
7.2.110.0030.00716.93
7.2.100.0030.00916.54
7.2.90.0000.01317.13
7.2.80.0030.00917.11
7.2.70.0110.00916.32
7.2.60.0090.00916.19
7.2.50.0120.00516.03
7.2.40.0090.01016.19
7.2.30.0280.00816.22
7.2.20.0080.00916.29
7.2.10.0120.01116.32
7.2.00.0090.00816.33
7.1.250.0060.00616.01
7.1.200.0030.01015.81
7.1.170.0120.00914.76
7.1.160.0090.00814.69
7.1.150.0130.00814.55
7.1.140.0110.01114.77
7.1.130.0090.01214.76
7.1.120.0110.00914.66
7.1.110.0150.00714.63
7.1.100.0150.00514.69
7.1.90.0090.00814.84
7.1.80.0150.00214.75
7.1.70.0040.01214.88
7.1.60.0250.00732.73
7.1.50.0210.01532.67
7.1.40.0200.01232.71
7.1.30.0260.01232.54
7.1.20.0220.01132.56
7.1.10.0090.00814.66
7.1.00.0100.00714.71

preferences:
33.79 ms | 403 KiB | 5 Q