3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Fiddle in response to StackOverflow question: https://stackoverflow.com/questions/69845122 // by HappyDog // According to the PHP documentation, returning false from an output-buffer // callback should result in the same result as returning the original input, // but this fiddle shows that returning false actually breaks the buffer if it // is 'cleaned'. The solution is to always return a string value. ////////////////////////////// // CALLBACKS // Returns false, which means 'use the buffer as supplied'. function ReturnFalse($Buffer, $Phase) { global $arrCallbacks; $arrCallbacks[] = array($Buffer, $Phase); return false; } // Returns the supplied buffer - result should be identical to returning false. function ReturnBuffer($Buffer, $Phase) { global $arrCallbacks; $arrCallbacks[] = array($Buffer, $Phase); return $Buffer; } ////////////////////////////// // TESTING CODE foreach (array("ReturnFalse", "ReturnBuffer") as $Callback) { $arrCallbacks = array(); print("== Testing " . $Callback . " ===\n"); ob_start($Callback); print("First\n"); ob_clean(); print("Second\n"); ob_end_flush(); print("\n"); var_dump($arrCallbacks); }

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.0110.00716.75
8.3.50.0070.01319.84
8.3.40.0070.01019.21
8.3.30.0100.01018.77
8.3.20.0000.00724.18
8.3.10.0030.00624.66
8.3.00.0080.00026.16
8.2.180.0070.00725.92
8.2.170.0110.00318.95
8.2.160.0120.00322.96
8.2.150.0060.00325.66
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00819.63
8.2.110.0060.00322.16
8.2.100.0060.00617.72
8.2.90.0030.00517.63
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0040.00417.46
8.2.50.0030.00517.63
8.2.40.0040.00419.89
8.2.30.0040.00417.66
8.2.20.0030.00519.34
8.2.10.0000.00817.74
8.2.00.0040.00419.23
8.1.280.0100.00625.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0090.00023.92
8.1.230.0070.00419.12
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0080.00017.35
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0080.00017.62
8.1.160.0030.00518.90
8.1.150.0000.00718.64
8.1.140.0050.00217.46
8.1.130.0000.00717.43
8.1.120.0000.00717.39
8.1.110.0040.00417.36
8.1.100.0020.00517.50
8.1.90.0000.00717.41
8.1.80.0040.00417.52
8.1.70.0030.00317.38
8.1.60.0040.00417.60
8.1.50.0050.00317.54
8.1.40.0040.00417.54
8.1.30.0100.00017.66
8.1.20.0030.00617.63
8.1.10.0090.00317.47
8.1.00.0060.00317.46
8.0.300.0050.00218.77
8.0.290.0000.00716.75
8.0.280.0000.00717.93
8.0.270.0000.00716.75
8.0.260.0000.00716.83
8.0.250.0030.00316.98
8.0.240.0040.00416.84
8.0.230.0070.00016.90
8.0.220.0030.00316.88
8.0.210.0070.00016.95
8.0.200.0000.00716.86
8.0.190.0040.00416.92
8.0.180.0000.00716.94
8.0.170.0030.00516.85
8.0.160.0070.00016.95
8.0.150.0000.00716.87
8.0.140.0000.00716.80
8.0.130.0060.00013.40
8.0.120.0060.00213.25
8.0.110.0120.00013.27
8.0.100.0090.00413.24
8.0.90.0130.00013.32
8.0.80.0090.00313.36
8.0.70.0000.00813.31
8.0.60.0080.00013.37
8.0.50.0060.00613.31
8.0.30.0000.00913.22
8.0.20.0030.00313.41
8.0.10.0070.00213.39
8.0.00.0040.00413.40
7.4.330.0000.00515.55
7.4.320.0000.00616.61
7.4.300.0030.00316.51
7.4.290.0000.00716.45
7.4.280.0000.00716.42
7.4.270.0030.00316.53
7.4.260.0000.00513.25
7.4.250.0080.00013.29
7.4.240.0050.00213.33
7.4.230.0020.00513.32
7.4.220.0110.00013.27
7.4.210.0100.00213.28
7.4.200.0080.00413.38
7.4.190.0130.00013.37
7.4.180.0070.00713.34
7.4.160.0000.01313.35
7.4.150.0080.00513.27
7.4.140.0090.00313.23
7.4.130.0100.00213.20
7.4.120.0100.00313.25
7.4.110.0090.00313.34
7.4.100.0040.00813.29
7.4.90.0040.00813.19
7.4.80.0070.00513.30
7.4.70.0120.00013.16
7.4.60.0120.00013.27
7.4.50.0060.00613.28
7.4.40.0060.00613.15
7.4.30.0120.00013.11
7.4.20.0060.00613.18
7.4.10.0060.00613.21
7.4.00.0000.01113.14
7.3.330.0070.00016.42
7.3.320.0080.00413.40
7.3.310.0100.00313.34
7.3.300.0100.00313.05
7.3.290.0130.00013.25
7.3.280.0110.00413.26
7.3.270.0070.00413.18
7.3.260.0100.00313.34
7.3.250.0090.00613.17
7.3.240.0070.00713.27
7.3.230.0100.00313.14
7.3.220.0110.00313.21
7.3.210.0140.00013.26
7.3.200.0130.00013.23
7.3.190.0000.01213.31
7.3.180.0100.00213.11
7.3.170.0090.00313.07
7.3.160.0120.00013.04
7.3.150.0030.00313.22
7.3.140.0070.00013.26
7.3.130.0030.00513.12
7.3.120.0030.00413.26
7.3.110.0090.00213.02
7.3.100.0060.00613.19
7.3.90.0070.00313.47
7.3.80.0040.00413.23
7.3.70.0030.00613.41
7.3.60.0050.00313.44
7.3.50.0020.00413.30
7.3.40.0030.00313.30
7.3.30.0060.00013.26
7.3.20.0070.00415.26
7.3.10.0110.00014.92
7.3.00.0080.00715.15
7.2.340.0070.00513.16
7.2.330.0130.00013.14
7.2.320.0100.00213.26
7.2.310.0100.00313.34
7.2.300.0100.00313.33
7.2.290.0070.00713.14
7.2.280.0090.00413.14
7.2.270.0090.00413.11
7.2.260.0110.00313.29
7.2.250.0060.00613.28
7.2.240.0120.00013.10
7.2.230.0100.00313.31
7.2.220.0060.00713.11
7.2.210.0130.00013.15
7.2.200.0140.00013.49
7.2.190.0080.00613.33
7.2.180.0120.00013.54
7.2.170.0040.00813.36
7.2.160.0090.00213.53
7.2.150.0080.00415.29
7.2.140.0100.00315.30
7.2.130.0060.00615.46
7.2.120.0090.00315.40
7.2.110.0080.00515.25
7.2.100.0070.00515.42
7.2.90.0130.00315.20
7.2.80.0070.00615.30
7.2.70.0130.00015.36
7.2.60.0100.00315.43
7.2.50.0120.00015.38
7.2.40.0130.00015.39
7.2.30.0070.00615.22
7.2.20.0090.00415.28
7.2.10.0090.00415.25
7.2.00.0140.00015.44
7.1.330.0090.00314.26
7.1.320.0040.00814.18
7.1.310.0080.00414.40
7.1.300.0090.00214.39
7.1.290.0090.00314.25
7.1.280.0130.00014.47
7.1.270.0060.00614.22
7.1.260.0090.00314.41
7.1.250.0090.00214.15
7.1.240.0120.00014.40
7.1.230.0040.00814.32
7.1.220.0060.00614.36
7.1.210.0120.00014.35
7.1.200.0120.00014.33
7.1.190.0070.00514.18
7.1.180.0090.00314.35
7.1.170.0100.00214.20
7.1.160.0080.00414.16
7.1.150.0080.00314.34
7.1.140.0080.00414.29
7.1.130.0120.00014.33
7.1.120.0120.00014.34
7.1.110.0090.00314.32
7.1.100.0140.00014.14
7.1.90.0090.00314.11
7.1.80.0080.00414.31
7.1.70.0090.00214.16
7.1.60.0120.00014.35
7.1.50.0060.00614.31
7.1.40.0090.00214.37
7.1.30.0090.00314.34
7.1.20.0070.00514.12
7.1.10.0120.00014.26
7.1.00.0090.00314.29
7.0.330.0040.00814.02
7.0.320.0090.00214.25
7.0.310.0040.00814.16
7.0.300.0110.00014.24
7.0.290.0110.00014.24
7.0.280.0060.00514.06
7.0.270.0110.00014.04
7.0.260.0060.00614.20
7.0.250.0090.00314.38
7.0.240.0050.00514.20
7.0.230.0070.00414.41
7.0.220.0060.00614.27
7.0.210.0070.00414.10
7.0.200.0080.00414.31
7.0.190.0040.00814.14
7.0.180.0110.00014.32
7.0.170.0090.00214.39
7.0.160.0040.00714.04
7.0.150.0090.00314.23
7.0.140.0080.00414.22
7.0.130.0110.00014.16
7.0.120.0110.00214.14
7.0.110.0100.00214.25
7.0.100.0120.00014.27
7.0.90.0080.00414.27
7.0.80.0060.00614.16
7.0.70.0120.00013.98
7.0.60.0090.00214.25
7.0.50.0070.00413.95
7.0.40.0080.00314.09
7.0.30.0050.00514.08
7.0.20.0090.00314.23
7.0.10.0110.00014.25
7.0.00.0080.00314.06
5.6.400.0060.00612.73
5.6.390.0080.00412.80
5.6.380.0090.00312.90
5.6.370.0080.00412.77
5.6.360.0080.00412.80
5.6.350.0060.00612.64
5.6.340.0080.00412.77
5.6.330.0090.00312.87
5.6.320.0050.00612.90
5.6.310.0110.00012.75
5.6.300.0120.00012.63
5.6.290.0070.00412.86
5.6.280.0110.00012.65
5.6.270.0070.00412.84
5.6.260.0090.00212.87
5.6.250.0080.00412.61
5.6.240.0090.00312.90
5.6.230.0050.00513.06
5.6.220.0120.00012.97
5.6.210.0090.00313.02
5.6.200.0110.00013.18
5.6.190.0040.00713.01
5.6.180.0120.00013.05
5.6.170.0030.01013.19
5.6.160.0050.00512.89
5.6.150.0120.00012.84
5.6.140.0110.00213.13
5.6.130.0090.00313.12
5.6.120.0090.00312.96
5.6.110.0080.00312.88
5.6.100.0090.00213.05
5.6.90.0040.00713.00
5.6.80.0000.01112.86
5.6.70.0080.00312.76
5.6.60.0110.00012.99
5.6.50.0110.00012.94
5.6.40.0060.00413.06
5.6.30.0070.00312.76
5.6.20.0100.00012.93
5.6.10.0040.00712.92
5.6.00.0050.00512.66
5.5.380.0040.00812.79
5.5.370.0110.00013.02
5.5.360.0090.00212.60
5.5.350.0070.00412.78
5.5.340.0050.00512.78
5.5.330.0080.00312.93
5.5.320.0090.00312.75
5.5.310.0070.00412.94
5.5.300.0040.00712.64
5.5.290.0080.00412.79
5.5.280.0060.00612.59
5.5.270.0090.00312.79
5.5.260.0090.00312.93
5.5.250.0000.01112.80
5.5.240.0100.00012.93
5.5.230.0040.00712.88
5.5.220.0100.00012.62
5.5.210.0070.00312.82
5.5.200.0110.00012.84
5.5.190.0110.00012.93
5.5.180.0080.00412.66
5.5.170.0070.00412.93
5.5.160.0080.00312.84
5.5.150.0080.00312.57
5.5.140.0060.00612.63
5.5.130.0060.00612.73
5.5.120.0100.00012.72
5.5.110.0060.00512.54
5.5.100.0110.00013.01
5.5.90.0110.00012.91
5.5.80.0070.00413.05
5.5.70.0110.00012.85
5.5.60.0040.00712.90
5.5.50.0080.00313.05
5.5.40.0080.00412.63
5.5.30.0080.00312.96
5.5.20.0050.00512.88
5.5.10.0040.00712.76
5.5.00.0100.00012.66
5.4.450.0110.00012.85
5.4.440.0050.00512.99
5.4.430.0040.00712.84
5.4.420.0050.00513.02
5.4.410.0100.00013.01
5.4.400.0070.00412.98
5.4.390.0060.00412.96
5.4.380.0100.00012.80
5.4.370.0080.00312.88
5.4.360.0080.00212.79
5.4.350.0040.00712.95
5.4.340.0070.00312.79
5.4.330.0080.00212.93
5.4.320.0050.00512.63
5.4.310.0080.00312.86
5.4.300.0070.00412.95
5.4.290.0050.00512.85
5.4.280.0100.00012.76
5.4.270.0000.01012.85
5.4.260.0070.00412.81
5.4.250.0070.00412.95
5.4.240.0080.00212.61
5.4.230.0060.00412.59
5.4.220.0100.00012.61
5.4.210.0110.00012.77
5.4.200.0110.00012.59
5.4.190.0090.00312.59
5.4.180.0070.00512.77
5.4.170.0060.00612.46
5.4.160.0080.00312.45
5.4.150.0080.00212.40
5.4.140.0110.00012.57
5.4.130.0070.00312.79
5.4.120.0100.00012.95
5.4.110.0080.00312.98
5.4.100.0070.00313.00
5.4.90.0000.01012.70
5.4.80.0070.00312.90
5.4.70.0000.01012.89
5.4.60.0100.00012.72
5.4.50.0050.00512.80
5.4.40.0030.00712.66
5.4.30.0070.00312.68
5.4.20.0100.00012.90
5.4.10.0100.00012.89
5.4.00.0060.00312.66
5.3.290.0050.00513.19
5.3.280.0100.00013.22
5.3.270.0070.00413.28
5.3.260.0090.00313.00
5.3.250.0030.00713.05
5.3.240.0100.00013.03
5.3.230.0100.00012.90
5.3.220.0100.00013.02
5.3.210.0080.00412.99
5.3.200.0000.01012.89
5.3.190.0100.00012.93
5.3.180.0070.00413.26
5.3.170.0030.00713.03
5.3.160.0000.01013.27
5.3.150.0080.00313.07
5.3.140.0090.00213.12
5.3.130.0070.00512.94
5.3.120.0080.00313.05
5.3.110.0060.00613.14
5.3.100.0050.00513.20
5.3.90.0070.00312.92
5.3.80.0050.00513.13
5.3.70.0070.00313.08
5.3.60.0070.00313.14
5.3.50.0030.00713.13
5.3.40.0070.00412.93
5.3.30.0080.00312.96
5.3.20.0050.00512.86
5.3.10.0050.00512.91
5.3.00.0100.00012.76
5.2.170.0000.00911.78
5.2.160.0060.00311.89
5.2.150.0000.00812.04
5.2.140.0030.00612.07
5.2.130.0040.00411.80
5.2.120.0030.00612.16
5.2.110.0090.00211.84
5.2.100.0030.00612.10
5.2.90.0040.00411.87
5.2.80.0090.00011.77
5.2.70.0070.00211.94
5.2.60.0030.00611.95
5.2.50.0100.00011.88
5.2.40.0040.00412.05
5.2.30.0060.00311.77
5.2.20.0000.00911.84
5.2.10.0040.00411.72
5.2.00.0060.00311.64
5.1.60.0040.00411.03
5.1.50.0050.00210.75
5.1.40.0040.00410.94
5.1.30.0000.00711.29
5.1.20.0000.00811.00
5.1.10.0060.00210.95
5.1.00.0080.00010.79
5.0.50.0040.00210.05
5.0.40.0000.00610.05
5.0.30.0050.00210.05
5.0.20.0030.00510.05
5.0.10.0060.00010.05
5.0.00.0060.00010.05
4.4.90.0040.00010.05
4.4.80.0040.00010.05
4.4.70.0040.00010.05
4.4.60.0000.00410.05
4.4.50.0040.00010.05
4.4.40.0040.00010.05
4.4.30.0040.00010.05
4.4.20.0040.00010.05
4.4.10.0040.00010.05
4.4.00.0000.00310.05
4.3.110.0030.00010.05
4.3.100.0040.00010.05
4.3.90.0000.00410.05
4.3.80.0040.00010.05
4.3.70.0040.00010.05
4.3.60.0020.00210.05
4.3.50.0050.00010.05
4.3.40.0020.00210.05
4.3.30.0030.00010.05
4.3.20.0000.00310.05
4.3.10.0000.00310.05
4.3.00.0000.00310.05

preferences:
73.65 ms | 401 KiB | 5 Q