3v4l.org

run code in 300+ PHP versions simultaneously
<?php function assignIfSet($testable, &$assigned) { if(isset($testable)) { $assigned = $testable; return true; } $assigned = null; return false; } $arr = [ 'foo' => (object)[ 'bar' => (object)[ 'zigi' => 1 ] ] ]; if(assignIfSet($arr['foo']->bar->zigi, 'Hello World')) { echo 'Success'; } else { echo 'Failure'; }

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.3.60.0100.01018.68
8.3.50.0150.00521.97
8.3.40.0040.01118.67
8.3.30.0070.00718.91
8.3.20.0040.00420.13
8.3.10.0000.00723.51
8.3.00.0040.00419.07
8.2.180.0080.00818.41
8.2.170.0120.00322.96
8.2.160.0100.00320.21
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0070.00019.76
8.2.110.0060.00322.25
8.2.100.0070.00218.91
8.1.280.0070.01025.92
8.1.270.0090.00919.01
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00618.64
8.1.230.0060.00318.52
5.4.390.0170.05718.81
5.4.380.0100.06718.45
5.4.370.0230.05018.59
5.4.360.0170.06318.58
5.4.350.0230.05318.53
5.4.340.0300.04718.60
5.4.320.0170.05718.77
5.4.310.0200.05718.72
5.4.300.0200.06018.74
5.4.290.0300.04718.63
5.4.280.0370.06318.60
5.4.270.0200.05718.74
5.4.260.0300.06018.75
5.4.250.0400.06718.75
5.4.240.0400.06718.78
5.4.230.0300.05718.48
5.4.220.0370.04318.77
5.4.210.0370.04018.72
5.4.200.0170.05316.71
5.4.190.0230.05018.51
5.4.180.0330.05718.71
5.4.170.0300.04718.61
5.4.160.0400.04318.51
5.4.150.0330.04718.43
5.4.140.0270.05316.27
5.4.130.0270.07016.29
5.4.120.0270.05016.21
5.4.110.0270.04316.26
5.4.100.0070.06316.32
5.4.90.0200.05316.43
5.4.80.0270.05016.31
5.4.70.0200.06016.20
5.4.60.0270.04316.22
5.4.50.0300.04016.16
5.4.40.0170.05716.23
5.4.30.0300.04316.25
5.4.20.0130.06316.18
5.4.10.0230.04716.22
5.4.00.0200.05015.66
5.3.290.0300.05014.79
5.3.280.0370.04014.57
5.3.270.0200.05714.83
5.3.260.0330.04714.62
5.3.250.0230.07014.59
5.3.240.0330.06714.70
5.3.230.0300.06314.58
5.3.220.0370.06314.58
5.3.210.0300.05014.75
5.3.200.0200.05314.78
5.3.190.0200.05714.75
5.3.180.0170.05714.69
5.3.170.0400.04314.59
5.3.160.0300.04714.69
5.3.150.0170.06314.60
5.3.140.0230.05014.74
5.3.130.0200.06014.56
5.3.120.0230.05314.64
5.3.110.0270.05314.55
5.3.100.0200.06014.09
5.3.90.0200.06014.15
5.3.80.0230.05014.14
5.3.70.0170.05714.01
5.3.60.0170.05714.17
5.3.50.0200.05314.03
5.3.40.0270.05013.93
5.3.30.0430.05713.94
5.3.20.0430.05713.74
5.3.10.0200.05013.77
5.3.00.0200.05313.68
5.2.170.0200.04011.20
5.2.160.0200.04011.25
5.2.150.0230.04011.18
5.2.140.0230.04011.25
5.2.130.0230.03711.21
5.2.120.0170.04311.15
5.2.110.0200.04011.17
5.2.100.0100.05311.16
5.2.90.0270.04011.23
5.2.80.0270.03711.12
5.2.70.0200.04311.12
5.2.60.0200.04011.07
5.2.50.0170.04711.06
5.2.40.0270.03011.21
5.2.30.0200.04011.07
5.2.20.0170.04010.96
5.2.10.0200.03710.93
5.2.00.0130.04310.89
5.1.60.0100.04010.01
5.1.50.0130.03710.11
5.1.40.0130.03710.18
5.1.30.0130.03710.39
5.1.20.0300.02310.48
5.1.10.0130.03710.13
5.1.00.0170.03310.27
5.0.50.0070.0338.61
5.0.40.0130.0238.60
5.0.30.0130.0408.34
5.0.20.0070.0308.24
5.0.10.0100.0278.26
5.0.00.0070.0438.29
4.4.90.0170.0135.98
4.4.80.0100.0205.92
4.4.70.0070.0275.90
4.4.60.0030.0275.88
4.4.50.0100.0206.00
4.4.40.0170.0475.94
4.4.30.0130.0175.93
4.4.20.0100.0235.94
4.4.10.0030.0275.95
4.4.00.0030.0405.91
4.3.110.0100.0205.82
4.3.100.0030.0275.82
4.3.90.0030.0275.81
4.3.80.0030.0375.81
4.3.70.0070.0235.77
4.3.60.0100.0205.79
4.3.50.0100.0205.77
4.3.40.0070.0435.81
4.3.30.0030.0274.56
4.3.20.0070.0204.52
4.3.10.0030.0234.50
4.3.00.0000.0237.16

preferences:
28.47 ms | 401 KiB | 5 Q