3v4l.org

run code in 300+ PHP versions simultaneously
<?php function book($id) { $id = $id[1]; // qui recupero il libro partendo dall'id. $books = array( 'La regola dell\'equilibrio', 'Morte in mare aperto', 'La ballata di Adam Henry' ); if (array_key_exists($id, $books)) { return '['.$books[$id].']'; } return '[Libro non in archivio]'; } $text = "I miei libri preferiti sono:\n[libro=1] e [libro=210]"; $text = preg_replace_callback("/\[libro=(.+?)\]/", 'book', $text); echo $text;

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.00920.42
8.4.110.0100.01018.90
8.4.100.0130.00817.79
8.4.90.0120.00918.05
8.4.80.0100.01022.70
8.4.70.0140.00718.07
8.4.60.0110.01118.71
8.4.50.0130.00718.75
8.4.40.0160.00317.75
8.4.30.0120.00317.84
8.4.20.0100.01017.82
8.4.10.0100.01017.59
8.3.250.0090.01018.94
8.3.240.0140.00516.63
8.3.230.0140.00716.44
8.3.220.0130.00617.34
8.3.210.0130.00616.71
8.3.200.0050.00416.60
8.3.190.0060.00219.14
8.3.180.0140.00516.84
8.3.170.0070.01120.61
8.3.160.0050.00317.01
8.3.150.0100.01018.94
8.3.140.0080.00016.72
8.3.130.0000.00916.95
8.3.120.0080.00020.90
8.3.110.0080.00016.66
8.3.100.0100.01016.90
8.3.90.0040.00416.87
8.3.80.0000.01217.97
8.3.70.0120.00616.75
8.3.60.0110.00318.68
8.3.50.0130.00723.05
8.3.40.0040.01118.82
8.3.30.0080.00619.05
8.3.20.0000.00720.16
8.3.10.0040.00420.54
8.3.00.0080.00019.09
8.2.290.0110.00820.71
8.2.280.0080.01218.53
8.2.270.0150.00318.95
8.2.260.0080.00818.84
8.2.250.0140.00416.75
8.2.240.0060.00317.49
8.2.230.0040.00420.94
8.2.220.0060.00324.06
8.2.210.0070.01326.77
8.2.200.0040.01116.63
8.2.190.0140.00317.13
8.2.180.0130.00718.41
8.2.170.0070.00722.96
8.2.160.0100.00320.36
8.2.150.0030.00524.18
8.2.140.0000.00924.66
8.2.130.0040.00426.16
8.2.120.0040.00419.61
8.2.110.0050.00520.97
8.2.100.0090.00318.03
8.2.90.0030.00619.17
8.2.80.0080.00017.97
8.2.70.0040.00417.88
8.2.60.0000.00818.05
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0050.00219.52
8.2.20.0070.00017.85
8.2.10.0000.00818.21
8.2.00.0040.00417.92
8.1.330.0130.00616.76
8.1.320.0140.00618.22
8.1.310.0000.00718.45
8.1.300.0080.00820.04
8.1.290.0060.00618.88
8.1.280.0140.00725.92
8.1.270.0000.00820.75
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00421.27
8.1.230.0120.00017.58
8.1.220.0030.00617.79
8.1.210.0000.00818.77
8.1.200.0030.00717.48
8.1.190.0040.00417.50
8.1.180.0040.00418.10
8.1.170.0030.00518.71
8.1.160.0040.00418.93
8.1.150.0040.00418.97
8.1.140.0000.00717.66
8.1.130.0000.00817.90
8.1.120.0000.00717.64
8.1.110.0000.00717.53
8.1.100.0000.00717.57
8.1.90.0000.00717.66
8.1.80.0030.00717.55
8.1.70.0070.00017.58
8.1.60.0000.00817.69
8.1.50.0040.00417.53
8.1.40.0000.00717.65
8.1.30.0000.00917.65
8.1.20.0000.00817.66
8.1.10.0050.00317.72
8.1.00.0030.01017.52
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0000.00818.47
8.0.270.0030.00317.29
8.0.260.0080.00017.28
8.0.250.0000.00717.05
8.0.240.0000.00817.09
8.0.230.0030.00317.11
8.0.220.0030.00317.05
8.0.210.0030.00317.05
8.0.200.0030.00317.10
8.0.190.0080.00017.13
8.0.180.0000.00817.00
8.0.170.0000.00816.96
8.0.160.0040.00417.04
8.0.150.0000.00716.87
8.0.140.0080.00016.96
8.0.130.0050.00013.43
8.0.120.0040.00416.94
8.0.110.0040.00416.94
8.0.100.0030.00316.93
8.0.90.0030.00517.07
8.0.80.0160.00017.04
8.0.70.0030.00517.00
8.0.60.0040.00416.95
8.0.50.0040.00416.98
8.0.30.0140.01017.35
8.0.20.0110.00817.40
8.0.10.0030.00517.02
8.0.00.0060.01017.04
7.4.330.0050.00015.11
7.4.320.0030.00316.77
7.4.300.0060.00016.67
7.4.290.0070.00016.81
7.4.280.0040.00416.84
7.4.270.0000.00816.85
7.4.260.0000.00513.54
7.4.250.0040.00416.79
7.4.240.0040.00316.86
7.4.230.0030.00316.91
7.4.220.0070.01316.93
7.4.210.0060.01016.75
7.4.200.0060.00316.62
7.4.160.0120.00416.64
7.4.150.0120.00617.40
7.4.140.0050.01317.86
7.4.130.0140.00416.79
7.4.120.0110.01016.62
7.4.110.0090.01516.73
7.4.100.0100.01016.54
7.4.90.0100.01316.61
7.4.80.0130.00316.48
7.4.70.0150.00316.81
7.4.60.0050.01616.79
7.4.50.0020.00216.66
7.4.40.0000.01716.56
7.4.30.0140.00516.86
7.4.10.0090.00915.29
7.4.00.0030.01415.18
7.3.330.0000.00513.54
7.3.320.0050.00013.51
7.3.310.0000.00816.56
7.3.300.0000.00716.43
7.3.290.0060.00916.43
7.3.280.0110.00816.46
7.3.270.0090.00917.40
7.3.260.0160.00616.55
7.3.250.0150.00316.67
7.3.240.0070.01016.64
7.3.230.0120.00616.45
7.3.210.0090.00916.86
7.3.200.0060.01519.39
7.3.190.0080.00816.54
7.3.180.0060.01016.49
7.3.170.0000.01616.64
7.3.160.0150.00316.89
7.3.130.0060.01314.80
7.3.120.0070.01315.26
7.3.110.0100.01015.05
7.3.100.0030.01315.22
7.3.90.0030.01315.15
7.3.80.0060.00314.98
7.3.70.0070.00715.10
7.3.60.0000.01215.00
7.3.50.0040.00415.03
7.3.40.0060.00914.85
7.3.30.0060.00715.07
7.3.20.0030.00816.90
7.3.10.0080.00316.80
7.3.00.0060.00616.75
7.2.330.0120.01216.68
7.2.320.0060.01316.86
7.2.310.0120.00616.66
7.2.300.0100.00717.04
7.2.290.0070.01016.83
7.2.260.0060.01315.32
7.2.250.0070.01315.19
7.2.240.0060.00915.28
7.2.230.0040.01415.15
7.2.220.0030.01315.42
7.2.210.0040.00415.34
7.2.200.0110.00715.25
7.2.190.0000.01215.17
7.2.180.0030.00815.23
7.2.170.0030.01015.12
7.2.160.0120.00315.42
7.2.150.0070.00416.82
7.2.140.0000.01016.89
7.2.130.0090.00417.04
7.2.120.0100.00317.20
7.2.110.0050.00517.10
7.2.100.0110.00416.94
7.2.90.0030.01016.85
7.2.80.0070.00717.28
7.2.70.0060.00316.76
7.2.60.0160.00516.82
7.2.50.0090.00517.05
7.2.40.0040.00817.11
7.2.30.0040.01117.18
7.2.20.0090.00617.23
7.2.10.0040.01117.14
7.2.00.0030.01317.24
7.1.330.0030.00915.59
7.1.320.0070.01015.92
7.1.310.0110.00416.06
7.1.300.0110.00315.90
7.1.290.0040.00816.16
7.1.280.0030.00616.10
7.1.270.0040.01115.91
7.1.260.0070.00715.97
7.1.250.0150.00315.85
7.1.240.0030.00616.16
7.1.230.0100.00316.09
7.1.220.0040.01115.93
7.1.210.0030.00616.07
7.1.200.0040.00816.05
7.1.190.0030.01015.88
7.1.180.0040.01115.93
7.1.170.0000.01415.97
7.1.160.0070.00416.14
7.1.150.0030.01015.71
7.1.140.0040.00815.75
7.1.130.0030.00915.98
7.1.120.0090.00015.78
7.1.110.0030.01016.10
7.1.100.0030.01215.89
7.1.90.0040.00815.78
7.1.80.0000.00916.00
7.1.70.0020.00616.53
7.1.60.0060.01017.61
7.1.50.0120.00716.55
7.1.40.0110.00316.02
7.1.30.0080.00316.07
7.1.20.0060.00616.01
7.1.10.0080.00415.84
7.1.00.0090.03719.16
7.0.330.0030.00715.46
7.0.320.0000.01415.31
7.0.310.0030.01315.65
7.0.300.0070.00715.79
7.0.290.0070.00415.65
7.0.280.0100.00715.42
7.0.270.0000.01015.48
7.0.260.0050.00315.59
7.0.250.0040.00715.52
7.0.240.0040.00715.74
7.0.230.0030.00715.54
7.0.220.0050.00315.68
7.0.210.0060.00615.75
7.0.200.0020.01016.32
7.0.190.0030.01015.56
7.0.180.0000.00915.55
7.0.170.0040.00415.62
7.0.160.0070.00315.57
7.0.150.0030.00515.53
7.0.140.0070.03618.85
7.0.130.0040.00715.41
7.0.120.0050.00515.64
7.0.110.0130.00015.75
7.0.100.0000.01115.63
7.0.90.0000.00815.75
7.0.80.0080.00315.59
7.0.70.0130.00315.67
7.0.60.0090.03518.67
7.0.50.0050.04519.01
7.0.40.0090.04316.85
7.0.30.0040.05116.81
7.0.20.0050.04516.73
7.0.10.0040.03416.84
7.0.00.0090.04216.80
5.6.400.0040.00814.45
5.6.390.0030.01014.70
5.6.380.0050.00314.59
5.6.370.0060.00614.80
5.6.360.0000.00814.45
5.6.350.0050.00514.39
5.6.340.0000.01114.64
5.6.330.0040.00714.58
5.6.320.0040.00714.52
5.6.310.0100.00314.80
5.6.300.0000.00914.63
5.6.290.0060.00614.75
5.6.280.0030.04017.73
5.6.270.0030.00814.38
5.6.260.0040.01114.79
5.6.250.0080.00614.70
5.6.240.0080.00414.37
5.6.230.0000.00814.30
5.6.220.0120.00614.34
5.6.210.0050.04317.50
5.6.200.0060.03517.89
5.6.190.0020.04817.64
5.6.180.0060.02317.64
5.6.170.0070.04317.75
5.6.160.0020.04817.69
5.6.150.0050.04517.78
5.6.140.0080.04517.91
5.6.130.0070.04517.71
5.6.120.0050.02317.66
5.6.110.0100.02217.81
5.6.100.0040.04617.64
5.6.90.0080.04617.67
5.6.80.0020.04117.19
5.6.70.0070.04117.43
5.6.60.0080.03817.40
5.6.50.0120.03817.47
5.6.40.0050.02817.49
5.6.30.0010.04117.63
5.6.20.0050.02717.35
5.6.10.0050.04117.46
5.6.00.0020.04017.42
5.5.380.0060.00314.39
5.5.370.0040.01214.46
5.5.360.0000.01814.41
5.5.350.0050.03117.29
5.5.340.0030.04317.63
5.5.330.0070.04517.39
5.5.320.0020.04417.63
5.5.310.0030.04117.61
5.5.300.0050.03217.74
5.5.290.0030.03817.49
5.5.280.0030.02517.64
5.5.270.0020.03017.65
5.5.260.0000.03017.35
5.5.250.0070.04217.54
5.5.240.0050.04417.33
5.5.230.0000.05217.25
5.5.220.0080.04017.31
5.5.210.0090.03817.34
5.5.200.0040.03117.25
5.5.190.0080.03417.09
5.5.180.0020.04417.22
5.5.170.0030.00514.33
5.5.160.0040.04017.32
5.5.150.0050.04017.39
5.5.140.0000.04917.08
5.5.130.0030.04317.41
5.5.120.0090.03717.25
5.5.110.0010.04317.17
5.5.100.0080.02717.07
5.5.90.0030.03217.26
5.5.80.0080.03717.20
5.5.70.0080.04217.15
5.5.60.0030.03617.04
5.5.50.0070.03217.19
5.5.40.0060.04117.18
5.5.30.0050.04317.21
5.5.20.0090.03517.19
5.5.10.0050.04117.16
5.5.00.0020.04717.08
5.4.450.0070.03616.13
5.4.440.0030.02816.10
5.4.430.0020.03116.16
5.4.420.0050.04616.06
5.4.410.0020.03216.01
5.4.400.0040.03415.91
5.4.390.0040.04315.85
5.4.380.0070.03716.00
5.4.370.0050.03515.93
5.4.360.0080.03515.85
5.4.350.0060.03815.88
5.4.340.0020.03615.93
5.4.330.0040.00412.78
5.4.320.0030.04116.00
5.4.310.0080.03315.89
5.4.300.0030.04015.85
5.4.290.0030.04515.92
5.4.280.0050.04215.99
5.4.270.0020.03915.83
5.4.260.0070.03016.00
5.4.250.0020.04015.84
5.4.240.0040.04215.88
5.4.230.0050.04115.97
5.4.220.0030.04415.91
5.4.210.0020.02815.92
5.4.200.0050.04216.00
5.4.190.0050.04115.92
5.4.180.0010.04515.97
5.4.170.0030.03715.92
5.4.160.0030.04015.97
5.4.150.0060.03915.83
5.4.140.0030.04214.61
5.4.130.0050.04014.48
5.4.120.0080.03314.55
5.4.110.0050.03814.58
5.4.100.0060.04114.58
5.4.90.0030.04214.55
5.4.80.0040.03714.56
5.4.70.0050.03514.66
5.4.60.0020.02814.59
5.4.50.0000.04214.63
5.4.40.0030.03214.58
5.4.30.0020.04214.58
5.4.20.0040.04114.59
5.4.10.0070.03514.61
5.4.00.0050.03714.29
5.3.290.0030.07014.71
5.3.280.0000.05014.66
5.3.270.0030.07314.57
5.3.260.0000.08014.52
5.3.250.0070.07014.46
5.3.240.0030.06314.60
5.3.230.0030.08014.60
5.3.220.0030.07014.62
5.3.210.0030.06014.62
5.3.200.0000.08014.61
5.3.190.0070.05014.67
5.3.180.0030.06314.60
5.3.170.0000.08014.60
5.3.160.0070.07714.66
5.3.150.0000.07714.62
5.3.140.0000.07014.57
5.3.130.0030.07714.58
5.3.120.0030.05014.55
5.3.110.0070.06014.59
5.3.100.0000.06714.00
5.3.90.0030.07014.09
5.3.80.0030.06313.98
5.3.70.0030.07013.93
5.3.60.0200.06014.05
5.3.50.0070.05714.03
5.3.40.0000.04013.93
5.3.30.0030.06013.91
5.3.20.0030.06713.75
5.3.10.0030.07313.66
5.3.00.0070.03313.62
5.2.170.0070.06011.16
5.2.160.0000.05711.14
5.2.150.0030.02711.22
5.2.140.0030.03310.99
5.2.130.0000.06311.00
5.2.120.0000.06310.99
5.2.110.0030.05311.18
5.2.100.0000.03311.00
5.2.90.0000.03011.12
5.2.80.0030.02711.15
5.2.70.0000.03311.20
5.2.60.0070.02311.11
5.2.50.0000.03011.04
5.2.40.0030.02710.89
5.2.30.0000.03010.87
5.2.20.0030.02710.95
5.2.10.0030.02710.84
5.2.00.0000.02310.72
5.1.60.0000.02310.43
5.1.50.0000.02710.43
5.1.40.0000.02310.43
5.1.30.0000.02710.43
5.1.20.0000.02710.43
5.1.10.0000.03010.43
5.1.00.0030.02310.43
5.0.50.0000.02010.43
5.0.40.0000.02710.43
5.0.30.0000.02710.43
5.0.20.0000.01710.43
5.0.10.0000.02010.43
5.0.00.0000.02310.43
4.4.90.0000.01310.43
4.4.80.0000.01710.43
4.4.70.0000.01310.43
4.4.60.0030.01310.43
4.4.50.0000.01710.43
4.4.40.0070.02010.43
4.4.30.0000.01710.43
4.4.20.0000.02010.43
4.4.10.0000.01710.43
4.4.00.0000.02710.43
4.3.110.0030.01310.43
4.3.100.0030.01310.43
4.3.90.0000.01310.43
4.3.80.0030.02010.43
4.3.70.0000.01310.43
4.3.60.0000.01310.43
4.3.50.0000.01710.43
4.3.40.0000.02310.43
4.3.30.0030.01010.43
4.3.20.0000.01710.43
4.3.10.0030.01010.43
4.3.00.0000.01310.43

preferences:
30.46 ms | 403 KiB | 5 Q