3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { function __construct($gen) { $this->gen = $gen; } function __destruct() { echo "__destruct: "; var_dump($this->gen->current()); echo "=====\n"; } } function gen() { $self = yield (0); echo "After yield 0\n"; yield (new X($self)); echo "After yield X\n"; return 12; } $a = gen(); var_dump($a->current()); $a->send($a); var_dump($a->current()); $a->next(); var_dump($a->getReturn());

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.70.0100.01018.43
8.3.60.0100.01016.50
8.3.50.0120.00621.97
8.3.40.0100.00718.88
8.3.30.0070.00718.84
8.3.20.0050.00320.21
8.3.10.0040.00421.79
8.3.00.0090.00019.26
8.2.190.0090.00616.58
8.2.180.0040.01116.63
8.2.170.0070.01022.96
8.2.160.0100.00322.25
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00917.75
8.2.110.0090.00019.33
8.2.100.0090.00317.93
8.2.90.0060.00319.21
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0030.00619.34
8.2.30.0000.00920.50
8.2.20.0050.00317.57
8.2.10.0040.00418.07
8.2.00.0040.00417.97
8.1.280.0030.01025.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.54
8.1.230.0070.00417.52
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0030.00717.35
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0000.00818.87
8.1.160.0000.00722.08
8.1.150.0040.00418.85
8.1.140.0030.00519.58
8.1.130.0000.00717.63
8.1.120.0040.00417.46
8.1.110.0000.00717.41
8.1.100.0040.00417.36
8.1.90.0000.00817.49
8.1.80.0050.00317.47
8.1.70.0030.00517.51
8.1.60.0040.00417.50
8.1.50.0080.00017.44
8.1.40.0080.00017.51
8.1.30.0000.00817.59
8.1.20.0030.00517.63
8.1.10.0060.00317.63
8.1.00.0050.00317.53
8.0.300.0000.00818.77
8.0.290.0050.00216.75
8.0.280.0030.00318.46
8.0.270.0000.00717.17
8.0.260.0000.00617.25
8.0.250.0080.00017.01
8.0.240.0000.00717.00
8.0.230.0070.00016.95
8.0.220.0070.00316.89
8.0.210.0030.00516.93
8.0.200.0000.00716.93
8.0.190.0040.00416.83
8.0.180.0000.01116.92
8.0.170.0050.00316.87
8.0.160.0070.00016.83
8.0.150.0000.00716.89
8.0.140.0000.00716.75
8.0.130.0000.00613.33
8.0.120.0030.00616.90
8.0.110.0070.00016.88
8.0.100.0070.00016.74
8.0.90.0000.00716.79
8.0.80.0070.00716.78
8.0.70.0050.00316.87
8.0.60.0040.00416.85
8.0.50.0040.00416.78
8.0.30.0080.01216.93
8.0.20.0120.00617.40
8.0.10.0070.00016.84
8.0.00.0120.01216.82
7.4.330.0020.00215.08
7.4.320.0070.00016.61
7.4.300.0060.00016.61
7.4.290.0000.00716.59
7.4.280.0040.00416.41
7.4.270.0000.00716.56
7.4.260.0030.00716.52
7.4.250.0050.00216.45
7.4.240.0060.00116.54
7.4.230.0040.00416.59
7.4.220.0090.00916.71
7.4.210.0080.00716.48
7.4.200.0070.00016.64
7.4.160.0110.00516.45
7.4.150.0130.00717.40
7.4.140.0060.01317.86
7.4.130.0110.01416.41
7.4.120.0110.00816.47
7.4.110.0000.02116.59
7.4.100.0070.01116.42
7.4.90.0070.01016.59
7.4.80.0070.01119.39
7.4.70.0070.01116.45
7.4.60.0080.00916.65
7.4.50.0050.00316.52
7.4.40.0130.00316.50
7.4.30.0060.01216.47
7.4.00.0030.01315.14
7.3.330.0000.00513.25
7.3.320.0000.00613.31
7.3.310.0050.00316.32
7.3.300.0030.00316.13
7.3.290.0070.00016.16
7.3.280.0120.00816.30
7.3.270.0210.00417.40
7.3.260.0140.00316.49
7.3.240.0160.00516.38
7.3.230.0000.01616.52
7.3.210.0080.00816.50
7.3.200.0140.00316.24
7.3.190.0100.00716.43
7.3.180.0070.01116.55
7.3.170.0100.01016.27
7.3.160.0030.01516.41
7.2.330.0090.01516.88
7.2.320.0070.01016.66
7.2.310.0070.01016.83
7.2.300.0040.01416.76
7.2.290.0120.00816.72
7.2.60.0040.01116.63
7.2.00.0060.00619.28
7.1.200.0080.00815.66
7.1.100.0030.01018.23
7.1.70.0000.01416.84
7.1.60.0190.00319.43
7.1.50.0100.00716.80
7.1.00.0030.07722.40
7.0.200.0080.00314.88
7.0.60.0100.07319.84
7.0.50.0070.07017.89
7.0.40.0130.08720.10
7.0.30.0170.04320.13
7.0.20.0230.07020.17
7.0.10.0070.06320.16
7.0.00.0030.05320.19
5.6.280.0030.05721.11
5.6.210.0030.05720.68
5.6.200.0130.05318.27
5.6.190.0070.07320.55
5.6.180.3130.03320.61
5.6.170.0070.05020.61
5.6.160.0030.07020.51
5.6.150.0030.05318.15
5.6.140.0070.08018.21
5.6.130.0170.07718.28
5.6.120.0030.05021.02
5.6.110.0130.08020.92
5.6.100.0130.06321.12
5.6.90.0130.05021.01
5.6.80.0070.08320.41
5.5.350.0070.07720.50
5.5.340.0130.06018.09
5.5.330.0130.06720.43
5.5.320.0130.07720.42
5.5.310.0230.04320.27
5.5.300.0070.05318.08
5.5.290.0070.08017.94
5.5.280.0100.08020.66
5.5.270.0130.08020.97
5.5.260.0000.04320.77
5.5.250.0070.03720.54
5.5.240.0000.04320.18
5.4.450.0970.06719.20
5.4.440.0630.06019.32
5.4.430.0570.06719.57
5.4.420.0570.07319.33
5.4.410.0730.07319.48
5.4.400.0330.06019.31
5.4.390.0230.05319.20
5.4.380.0470.05319.28
5.4.370.0500.05318.98
5.4.360.0700.07719.11
5.4.350.0200.07318.84
5.4.340.0200.05319.38
5.4.320.0270.04719.23
5.4.310.0530.04319.22
5.4.300.0070.06719.25
5.4.290.0200.06018.84
5.4.280.0270.04319.37
5.4.270.0200.04719.36
5.4.260.0200.05018.87
5.4.250.0230.04719.24
5.4.240.0070.06019.11
5.4.230.0470.04719.14
5.4.220.0530.06319.24
5.4.210.0900.06019.22
5.4.200.0730.05019.10
5.4.190.0170.05318.83
5.4.180.0330.06019.36
5.4.170.0370.04719.13
5.4.160.0100.06319.21
5.4.150.0300.04718.86
5.4.140.0270.04716.79
5.4.130.0300.07016.60
5.4.120.0170.05316.36
5.4.110.0100.06316.46
5.4.100.0070.06316.58
5.4.90.0270.04716.56
5.4.80.0130.05016.65
5.4.70.0300.05316.63
5.4.60.0300.05716.43
5.4.50.0230.04316.48
5.4.40.0200.04716.49
5.4.30.0300.04716.41
5.4.20.0130.05316.16
5.4.10.0300.06316.48
5.4.00.0170.05015.96

preferences:
52.82 ms | 401 KiB | 5 Q