3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen(int $x) { $x = yield $x + 1; $x = yield $x + 2; $x = yield $x + 3; $x = yield $x + 4; } $gen = gen(5); $assertions = [ ['expect' => 6], ['send' => 1, 'expect' => 3], ['send' => 5, 'expect' => 8], ['send' => 3, 'expect' => 7], ]; foreach($assertions as $assertion) { if(!array_key_exists('send', $assertion)) { echo '(Received / Initial Assertion / Whatever) ' . $gen->current() . PHP_EOL; continue; } echo $assertion['expect'] . ' === ' . $gen->send($assertion['send']) . 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.120.0120.00720.43
8.4.110.0120.00820.45
8.4.100.0030.00517.81
8.4.90.0120.00620.36
8.4.80.0100.00818.75
8.4.70.0110.00518.86
8.4.60.0140.00619.00
8.4.50.0110.01018.47
8.4.40.0100.01019.55
8.4.30.0120.01219.36
8.4.20.0070.01318.59
8.4.10.0000.02019.54
8.3.250.0130.00619.09
8.3.240.0120.00716.52
8.3.230.0020.00616.73
8.3.220.0060.00318.86
8.3.210.0020.00618.35
8.3.200.0060.00316.48
8.3.190.0120.01016.92
8.3.180.0070.01118.83
8.3.170.0090.00617.00
8.3.160.0140.00319.17
8.3.150.0100.01017.24
8.3.140.0090.00919.16
8.3.130.0090.00018.34
8.3.120.0060.00318.96
8.3.110.0090.00020.94
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0030.00617.97
8.3.70.0090.01216.43
8.3.60.0160.00618.43
8.3.50.0110.00721.04
8.3.40.0070.00718.77
8.3.30.0040.01118.55
8.3.20.0090.00919.78
8.3.10.0070.00021.90
8.3.00.0070.00023.70
8.2.290.0090.00816.45
8.2.280.0120.00718.61
8.2.270.0090.00920.58
8.2.260.0130.00616.68
8.2.250.0120.00616.48
8.2.240.0060.00316.97
8.2.230.0000.00922.58
8.2.220.0070.00337.54
8.2.210.0100.00326.77
8.2.200.0100.00016.63
8.2.190.0000.01518.02
8.2.180.0070.01316.32
8.2.170.0070.00722.96
8.2.160.0150.00420.48
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.18
8.2.110.0070.00320.92
8.2.100.0040.00817.54
8.2.90.0040.00419.20
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0080.00017.93
8.2.50.0030.00519.29
8.2.40.0000.00820.58
8.2.30.0050.00220.31
8.2.20.0040.00417.99
8.2.10.0000.00718.07
8.2.00.0040.00418.36
8.1.330.0100.01016.10
8.1.320.0150.00716.25
8.1.310.0090.00016.70
8.1.300.0060.00316.05
8.1.290.0080.00030.84
8.1.280.0070.01925.92
8.1.270.0000.00823.97
8.1.260.0110.00026.35
8.1.250.0060.00328.09
8.1.240.0090.00021.36
8.1.230.0040.00719.23
8.1.220.0080.00017.74
8.1.210.0030.00718.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0000.00718.10
8.1.170.0030.00618.62
8.1.160.0040.00418.74
8.1.150.0080.00020.17
8.1.140.0050.00219.48
8.1.130.0000.00719.01
8.1.120.0050.00217.46
8.1.110.0000.00817.43
8.1.100.0040.00417.52
8.1.90.0040.00417.46
8.1.80.0000.00817.45
8.1.70.0000.00717.35
8.1.60.0000.00817.56
8.1.50.0050.00317.53
8.1.40.0040.00417.44
8.1.30.0080.00017.69
8.1.20.0050.00217.63
8.1.10.0050.00317.46
8.1.00.0000.00717.39
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.31
8.0.270.0000.00717.21
8.0.260.0030.00317.17
8.0.250.0070.00017.00
8.0.240.0080.00016.91
8.0.230.0070.00016.93
8.0.220.0070.00016.90
8.0.210.0060.00016.75
8.0.200.0000.00716.83
8.0.190.0040.00416.93
8.0.180.0060.00316.91
8.0.170.0040.00416.86
8.0.160.0030.00316.93
8.0.150.0000.00816.74
8.0.140.0070.00016.83
8.0.130.0040.00413.36
8.0.120.0030.00516.90
8.0.110.0040.00416.91
8.0.100.0030.00316.73
8.0.90.0070.00016.90
8.0.80.0030.01616.94
8.0.70.0040.00416.84
8.0.60.0000.00716.95
8.0.50.0050.00216.75
8.0.30.0130.00816.92
8.0.20.0110.00917.40
8.0.10.0030.00316.87
8.0.00.0060.01216.62
7.4.330.0020.00215.55
7.4.320.0040.00416.52
7.4.300.0030.00316.43
7.4.290.0030.00316.40
7.4.280.0080.00016.49
7.4.270.0030.00316.52
7.4.260.0080.00416.53
7.4.250.0000.00716.55
7.4.240.0030.00316.52
7.4.230.0030.00316.34
7.4.220.0110.00716.52
7.4.210.0050.01016.61
7.4.200.0000.00816.44
7.4.160.0020.01416.44
7.4.150.0070.01317.40
7.4.140.0060.01217.86
7.4.130.0130.00716.56
7.4.120.0120.00716.50
7.4.110.0100.01016.63
7.4.100.0150.00316.49
7.4.90.0140.00316.47
7.4.80.0100.00619.39
7.4.70.0120.00616.27
7.4.60.0000.01616.55
7.4.50.0120.00316.14
7.4.40.0100.01416.67
7.4.30.0120.00916.58
7.4.00.0050.01014.88
7.3.330.0030.00313.30
7.3.320.0050.00013.36
7.3.310.0070.00016.27
7.3.300.0000.00716.23
7.3.290.0000.00716.38
7.3.280.0070.00916.35
7.3.270.0130.00317.40
7.3.260.0080.01316.35
7.3.250.0080.01016.44
7.3.240.0080.00816.58
7.3.230.0060.01316.41
7.3.210.0090.00616.32
7.3.200.0160.00616.45
7.3.190.0140.01016.63
7.3.180.0070.01016.31
7.3.170.0070.01016.65
7.3.160.0040.01216.73
7.3.120.0030.01414.79
7.3.110.0060.01215.02
7.3.100.0100.00314.70
7.3.90.0030.01414.81
7.3.80.0110.00715.05
7.3.70.0030.01014.80
7.3.60.0090.00614.97
7.3.50.0100.00714.55
7.3.40.0110.00314.85
7.3.30.0060.01214.95
7.3.20.0100.00616.72
7.3.10.0130.00316.82
7.3.00.0060.01216.66
7.2.330.0030.01316.46
7.2.320.0100.01016.77
7.2.310.0060.01016.56
7.2.300.0170.01016.62
7.2.290.0060.01616.59
7.2.250.0100.00615.09
7.2.240.0070.01315.27
7.2.230.0090.00915.22
7.2.220.0000.01015.09
7.2.210.0100.01015.04
7.2.200.0030.00615.07
7.2.190.0090.00915.02
7.2.180.0070.01315.27
7.2.170.0000.01415.21
7.2.60.0040.01117.01
7.2.00.0050.01419.05
7.1.330.0040.01115.75
7.1.320.0080.00815.59
7.1.310.0040.00715.80
7.1.300.0110.00815.74
7.1.290.0090.00915.89
7.1.280.0000.01315.84
7.1.270.0040.01215.62
7.1.260.0090.00915.54
7.1.200.0110.00415.52
7.1.100.0060.00618.20
7.1.70.0040.00417.25
7.1.60.0030.00716.95
7.1.50.0120.00416.91
7.1.20.0130.07740.38
7.1.10.0800.06020.41
7.1.00.1230.07720.62
7.0.200.0030.01016.85
7.0.160.0800.05721.91
7.0.150.0130.07721.85
7.0.140.0100.07721.84
7.0.130.0030.07021.88
7.0.120.0900.06020.14
7.0.110.0130.07021.89
7.0.100.0170.05021.92
7.0.90.0070.05722.02
7.0.80.0970.04321.92
7.0.70.0700.05720.07
7.0.60.0170.04721.82
7.0.50.0070.05721.84
7.0.40.0000.06321.91
7.0.30.0270.04721.93
7.0.20.0130.05721.92
7.0.10.0170.05021.83
7.0.00.0100.06321.97

preferences:
95.28 ms | 403 KiB | 5 Q