3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 1; $b = 2; $content = <<<BLOCK <h1>Some Html</h1> <hr> {IF:($a + $b === 3)} <b>Yes :)</b> {ELSE} <b>No :(</b> {ENDIF} Another one... {IF:($a + $b === 4)} <b>:)</b> {ELSE} <b>:(</b> {ENDIF} Some more Text BLOCK; echo render($content); function render($content) { $match = preg_match_all('/{IF:\((.*?)\)}(.*?){ELSE}(.*?)({ENDIF})/s', $content, $matches, PREG_OFFSET_CAPTURE); if (!$match) { return $content; } $beforeIf = substr($content, 0, $matches[0][0][1]); $afterIf = substr($content, $matches[4][0][1] + strlen('{ENDIF}')); $evalCondition = eval('return (' . $matches[1][0][0] . ');'); if ($evalCondition) { $ifResult = $matches[2][0][0]; } else { $ifResult = $matches[3][0][0]; } return $beforeIf . $ifResult . render($afterIf); }

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.140.0150.00617.77
8.4.130.0110.00618.08
8.4.120.0140.00620.16
8.4.110.0150.00520.65
8.4.100.0120.00818.80
8.4.90.0060.00420.56
8.4.80.0110.01118.71
8.4.70.0070.00718.98
8.4.60.0130.00920.53
8.4.50.0110.00919.01
8.4.40.0100.01017.75
8.4.30.0030.01720.33
8.4.20.0170.00326.11
8.4.10.0160.00021.37
8.3.270.0080.01116.89
8.3.260.0090.00916.97
8.3.250.0120.00816.78
8.3.240.0050.00316.57
8.3.230.0110.00816.86
8.3.220.0110.01018.89
8.3.210.0140.00616.57
8.3.200.0030.00616.96
8.3.190.0120.00617.25
8.3.180.0070.00118.73
8.3.170.0090.00916.69
8.3.160.0090.00917.23
8.3.150.0050.00319.10
8.3.140.0060.01218.95
8.3.130.0050.00318.40
8.3.120.0060.00319.21
8.3.110.0060.00320.94
8.3.100.0170.00316.81
8.3.90.0000.00816.84
8.3.80.0060.00319.36
8.3.70.0060.00916.58
8.3.60.0090.00618.68
8.3.50.0110.00825.46
8.3.40.0140.00019.06
8.3.30.0070.00718.96
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0030.00626.16
8.2.290.0100.00817.28
8.2.280.0130.00618.27
8.2.270.0090.00916.91
8.2.260.0160.00317.04
8.2.250.0060.00318.59
8.2.240.0030.00719.21
8.2.230.0100.00622.58
8.2.220.0040.00424.06
8.2.210.0080.00026.77
8.2.200.0060.00316.88
8.2.190.0110.00716.58
8.2.180.0100.01425.92
8.2.170.0070.00719.06
8.2.160.0110.01122.96
8.2.150.0090.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00426.35
8.2.110.0100.00020.29
8.2.100.0070.00417.91
8.2.90.0030.00617.97
8.2.80.0080.00018.05
8.2.70.0050.00517.93
8.2.60.0000.00818.22
8.2.50.0070.00318.10
8.2.40.0030.00619.30
8.2.30.0030.00519.48
8.2.20.0030.00618.30
8.2.10.0060.00319.42
8.2.00.0000.00719.48
8.1.330.0090.00216.60
8.1.320.0110.01016.34
8.1.310.0040.00416.59
8.1.300.0030.00518.80
8.1.290.0000.00918.88
8.1.280.0110.00425.92
8.1.270.0000.00823.99
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0000.00823.92
8.1.230.0060.00622.73
8.1.220.0080.00017.79
8.1.210.0120.00220.07
8.1.200.0040.00417.35
8.1.190.0060.00317.37
8.1.180.0050.00318.10
8.1.170.0030.00718.73
8.1.160.0000.00818.98
8.1.150.0040.00418.99
8.1.140.0070.00018.93
8.1.130.0000.00720.05
8.1.120.0060.00317.70
8.1.110.0060.00317.50
8.1.100.0040.00717.64
8.1.90.0040.00417.65
8.1.80.0030.00717.52
8.1.70.0070.00017.64
8.1.60.0000.00817.71
8.1.50.0040.00417.67
8.1.40.0000.00817.73
8.1.30.0000.00917.85
8.1.20.0120.00017.77
8.1.10.0000.00917.71
8.1.00.0060.00317.61
8.0.300.0000.00820.34
8.0.290.0000.00816.88
8.0.280.0000.00718.48
8.0.270.0030.00316.98
8.0.260.0060.00020.29
8.0.250.0040.00417.11
8.0.240.0030.00317.20
8.0.230.0000.00717.18
8.0.220.0030.00317.01
8.0.210.0070.00017.14
8.0.200.0040.00417.10
8.0.190.0000.00717.06
8.0.180.0040.00417.06
8.0.170.0000.00817.16
8.0.160.0000.00717.08
8.0.150.0050.00217.14
8.0.140.0000.00717.07
8.0.130.0050.00013.51
8.0.120.0000.00817.12
8.0.110.0000.00717.18
8.0.100.0060.00317.09
8.0.90.0050.00216.91
8.0.80.0090.00517.10
8.0.70.0040.00417.10
8.0.60.0080.00017.04
8.0.50.0070.00017.04
8.0.30.0100.01017.34
8.0.20.0100.01017.37
8.0.10.0040.00417.05
8.0.00.0130.00716.90
7.4.330.0000.00515.55
7.4.320.0030.00316.73
7.4.300.0070.00016.75
7.4.290.0000.00716.73
7.4.280.0000.00716.77
7.4.270.0000.00816.89
7.4.260.0000.00513.46
7.4.250.0050.00216.63
7.4.240.0030.00316.74
7.4.230.0040.00416.64
7.4.220.0040.00316.78
7.4.210.0080.00916.81
7.4.200.0070.00016.48
7.4.130.0090.00916.84
7.4.120.0110.00816.74
7.4.110.0090.01016.66
7.4.100.0120.00916.58
7.4.90.0070.01216.75
7.4.80.0190.00716.80
7.4.70.0180.00616.69
7.4.60.0150.00716.79
7.4.50.0150.00816.66
7.4.40.0150.00516.60
7.4.30.0140.00816.62
7.4.20.0110.01016.68
7.4.10.0130.01016.82
7.4.00.0100.01216.71
7.3.330.0070.00016.45
7.3.320.0030.00313.59
7.3.310.0040.00416.65
7.3.300.0000.00716.65
7.3.290.0100.00616.57
7.3.280.0080.00816.57
7.3.260.0150.00716.83
7.3.240.0120.00616.62
7.3.230.0140.00316.62
7.3.220.0090.00916.60
7.3.210.0110.00816.71
7.3.200.0160.00716.69
7.3.190.0140.01016.63
7.3.180.0170.01016.64
7.3.170.0120.01116.64
7.3.160.0100.01216.64
7.3.150.0150.00716.68
7.3.140.0140.00716.73
7.3.130.0100.00816.68
7.3.120.0080.01116.65
7.3.110.0090.01116.56
7.3.100.0130.00616.66
7.3.90.0100.01016.55
7.3.80.0110.01216.67
7.3.70.0140.00916.59
7.3.60.0100.01416.58
7.3.50.0130.01016.56
7.3.40.0140.00816.62
7.3.30.0140.00516.55
7.3.20.0130.00816.61
7.3.10.0110.01016.58
7.3.00.0130.00716.59
7.2.340.0000.01816.64
7.2.330.0120.00716.94
7.2.320.0090.01216.97
7.2.310.0130.00916.83
7.2.300.0150.00816.94
7.2.290.0170.00616.84
7.2.280.0140.00716.86
7.2.270.0140.00816.81
7.2.260.0130.00816.82
7.2.250.0100.01116.88
7.2.240.0080.01216.80
7.2.230.0110.01016.84
7.2.220.0100.01016.86
7.2.210.0090.01416.78
7.2.200.0120.01316.79
7.2.190.0130.01216.78
7.2.180.0180.00516.75
7.2.170.0140.01016.88
7.2.160.0090.01116.79
7.2.150.0160.00916.89
7.2.140.0120.01316.84
7.2.130.0110.01016.83
7.2.120.0130.00916.90
7.2.110.0110.01216.90
7.2.100.0130.00916.86
7.2.90.0140.00716.85
7.2.80.0120.00716.94
7.2.70.0090.01216.76
7.2.60.0110.00916.87
7.2.50.0110.00916.91
7.2.40.0110.00916.86
7.2.30.0130.00916.84
7.2.20.0130.01216.88
7.2.10.0100.01216.86
7.2.00.0160.00716.71
7.1.330.0130.01315.93
7.1.320.0250.00815.88
7.1.310.0210.01415.91
7.1.300.0330.00415.75
7.1.290.0190.01615.80
7.1.280.0220.01415.82
7.1.270.0340.00915.86
7.1.260.0260.00915.83
7.1.250.0220.01015.80
7.1.240.0280.00615.80
7.1.230.0250.00615.83
7.1.220.0300.00315.90
7.1.210.0320.00415.71
7.1.200.0260.00615.82
7.1.190.0340.01215.87
7.1.180.0210.01015.85
7.1.170.0290.00515.71
7.1.160.0260.01015.82
7.1.150.0230.00915.82
7.1.140.0260.00715.90
7.1.130.0230.00915.74
7.1.120.0300.00315.81
7.1.110.0200.01315.88
7.1.100.0270.00615.75
7.1.90.0320.00615.87
7.1.80.0330.00515.80
7.1.70.0220.01315.80
7.1.60.0290.00715.93
7.1.50.0220.00815.88
7.1.40.0260.00915.98
7.1.30.0330.00915.93
7.1.20.0270.00515.83
7.1.10.0190.01415.76
7.1.00.0370.00815.77
7.0.330.0330.00315.50
7.0.320.0260.00615.60
7.0.310.0270.01215.46
7.0.300.0260.00615.49
7.0.290.0240.00815.39
7.0.280.0250.00815.45
7.0.270.0250.00915.49
7.0.260.0230.01015.48
7.0.250.0350.01115.49
7.0.240.0190.01215.60
7.0.230.0190.01415.55
7.0.220.0290.01015.50
7.0.210.0250.00915.48
7.0.200.0260.01115.46
7.0.190.0250.00815.51
7.0.180.0260.00815.59
7.0.170.0240.01115.55
7.0.160.0230.01715.49
7.0.150.0250.01015.58
7.0.140.0220.00915.51
7.0.130.0250.01015.52
7.0.120.0180.01515.60
7.0.110.0210.01415.47
7.0.100.0310.00715.46
7.0.90.0200.01315.43
7.0.80.0210.01315.50
7.0.70.0260.01115.37
7.0.60.0230.01415.49
7.0.50.0220.01015.44
7.0.40.0270.00815.44
7.0.30.0170.01615.42
7.0.20.0260.00815.40
7.0.10.0250.01015.46
7.0.00.0220.01215.44
5.6.400.0200.01416.01
5.6.390.0210.01216.29
5.6.380.0200.01416.07
5.6.370.0280.00316.16
5.6.360.0200.01116.12
5.6.350.0210.01116.22
5.6.340.0220.01116.09
5.6.330.0210.01115.94
5.6.320.0160.01715.90
5.6.310.0220.01516.02
5.6.300.0210.01516.21
5.6.290.0250.01215.97
5.6.280.0230.01216.17
5.6.270.0190.01716.11
5.6.260.0230.01216.09
5.6.250.0250.01216.23
5.6.240.0250.01416.25
5.6.230.0250.01116.10
5.6.220.0300.00816.10
5.6.210.0240.00916.04
5.6.200.0200.01316.21
5.6.190.0230.01316.28
5.6.180.0210.01616.04
5.6.170.0200.01716.06
5.6.160.0230.01316.06
5.6.150.0230.01116.10
5.6.140.0280.01116.13
5.6.130.0310.00416.32
5.6.120.0170.01816.11
5.6.110.0220.01315.98
5.6.100.0250.00815.95
5.6.90.0280.00916.08
5.6.80.0220.01316.12
5.6.70.0210.01115.80
5.6.60.0250.01115.88
5.6.50.0230.01016.04
5.6.40.0250.01116.10
5.6.30.0260.00816.10
5.6.20.0220.01416.02
5.6.10.0200.01616.07
5.6.00.0300.02315.94
5.5.380.0250.01115.98
5.5.370.0210.01516.19
5.5.360.0210.01516.18
5.5.350.0220.01416.11
5.5.340.0180.01616.08
5.5.330.0280.00815.99
5.5.320.0250.01216.09
5.5.310.0280.01015.94
5.5.300.0250.01115.96
5.5.290.0210.01416.16
5.5.280.0200.01516.01
5.5.270.0250.01016.00
5.5.260.0200.01415.95
5.5.250.0220.01215.92
5.5.240.0240.00915.96
5.5.230.0220.01215.96
5.5.220.0240.01115.75
5.5.210.0310.00615.93
5.5.200.0200.01416.08
5.5.190.0220.01416.00
5.5.180.0240.01115.85
5.5.170.0370.02216.05
5.5.160.0290.01215.89
5.5.150.0260.01215.98
5.5.140.0230.01215.76
5.5.130.0210.01316.02
5.5.120.0230.01215.93
5.5.110.0260.01015.86
5.5.100.0200.01415.89
5.5.90.0240.02115.96
5.5.80.0140.01715.89
5.5.70.0250.01015.74
5.5.60.0250.01015.95
5.5.50.0250.00615.88
5.5.40.0260.00815.89
5.5.30.0250.00915.89
5.5.20.0350.01015.89
5.5.10.0170.01516.00
5.5.00.0210.01215.92
5.4.450.0150.01112.82
5.4.440.0150.01012.95
5.4.430.0190.00612.96
5.4.420.0180.01012.96
5.4.410.0190.00512.90
5.4.400.0190.00612.82
5.4.390.0180.01012.80
5.4.380.0190.01012.83
5.4.370.0190.01112.85
5.4.360.0190.00512.75
5.4.350.0180.00612.94
5.4.340.0150.01212.82
5.4.330.0360.01312.82
5.4.320.0150.01512.82
5.4.310.0210.01012.92
5.4.300.0210.00612.85
5.4.290.0320.01012.87
5.4.280.0350.01012.76
5.4.270.0130.01712.86
5.4.260.0150.01112.75
5.4.250.0180.00912.80
5.4.240.0150.01112.73
5.4.230.0150.01212.86
5.4.220.0200.00712.88
5.4.210.0190.00812.79
5.4.200.0170.00812.91
5.4.190.0170.00912.79
5.4.180.0210.00812.88
5.4.170.0160.01012.79
5.4.160.0160.00812.81
5.4.150.0160.00812.74
5.4.140.0200.00312.91
5.4.130.0140.01012.91
5.4.120.0180.00912.90
5.4.110.0180.00612.75
5.4.100.0220.00412.80
5.4.90.0130.01012.87
5.4.80.0160.01012.83
5.4.70.0170.00812.83
5.4.60.0190.00712.82
5.4.50.0180.00412.88
5.4.40.0170.00712.85
5.4.30.0180.00512.80
5.4.20.0180.00612.85
5.4.10.0190.00612.86
5.4.00.0180.00712.88
5.3.290.0160.01113.34
5.3.280.0180.00913.21
5.3.270.0130.01313.18
5.3.260.0150.01013.12
5.3.250.0240.00613.32
5.3.240.0160.00913.12
5.3.230.0170.00913.19
5.3.220.0210.00813.12
5.3.210.0220.00712.98
5.3.200.0120.01413.17
5.3.190.0210.00613.18
5.3.180.0170.01013.27
5.3.170.0190.00913.28
5.3.160.0170.00813.23
5.3.150.0190.01113.20
5.3.140.0180.00913.25
5.3.130.0130.01213.26
5.3.120.0190.01013.12
5.3.110.0150.01413.21
5.3.100.0130.01113.17
5.3.90.0190.00913.37
5.3.80.0160.01113.10
5.3.70.0170.01013.04
5.3.60.0160.00913.21
5.3.50.0240.01413.05
5.3.40.0160.01213.11
5.3.30.0150.00913.15
5.3.20.0140.01113.14
5.3.10.0150.01113.10
5.3.00.0170.00813.06
5.2.170.0200.00412.51
5.2.160.0150.00912.50
5.2.150.0180.00312.46
5.2.140.0140.01112.49
5.2.130.0080.01212.38
5.2.120.0130.01012.49
5.2.110.0170.00512.47
5.2.100.0130.00812.41
5.2.90.0140.00812.45
5.2.80.0180.00912.34
5.2.70.0120.01012.38
5.2.60.0190.00312.30
5.2.50.0160.00512.48
5.2.40.0170.00412.44
5.2.30.0130.00612.37
5.2.20.0070.01312.31
5.2.10.0100.01212.27
5.2.00.0140.00712.27
5.1.60.0140.00611.98
5.1.50.0090.01011.98
5.1.40.0100.00911.94
5.1.30.0090.01011.98
5.1.20.0100.01012.06
5.1.10.0120.00611.95
5.1.00.0080.01011.88
5.0.50.0110.00411.41
5.0.40.0100.00511.37
5.0.30.0110.00611.30
5.0.20.0080.00711.39
5.0.10.0070.00811.31
5.0.00.0070.00811.26
4.4.90.0100.00310.54
4.4.80.0080.00210.54
4.4.70.0060.00510.54
4.4.60.0050.00510.54
4.4.50.0070.00210.54
4.4.40.0060.00410.54
4.4.30.0070.00410.54
4.4.20.0050.00510.54
4.4.10.0060.00310.54
4.4.00.0040.00610.54
4.3.110.0050.00610.54
4.3.100.0040.00410.54
4.3.90.0080.00210.54
4.3.80.0050.00510.54
4.3.70.0080.00310.54
4.3.60.0100.00110.54
4.3.50.0050.00510.54
4.3.40.0020.00810.54
4.3.30.0050.00410.54
4.3.20.0070.00310.54
4.3.10.0040.00510.54
4.3.00.0060.00310.54

preferences:
159.18 ms | 403 KiB | 5 Q