3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MarkupTrait { /** * The safe string. * * @var string */ protected $string; /** * Creates a Markup object if necessary. * * If $string is equal to a blank string then it is not necessary to create a * Markup object. If $string is an object that implements MarkupInterface it * is returned unchanged. * * @param mixed $string * The string to mark as safe. This value will be cast to a string. * * @return string|\Drupal\Component\Render\MarkupInterface * A safe string. */ public static function create($string) { if ($string instanceof MarkupInterface) { return $string; } $string = (string) $string; if ($string === '') { return ''; } $safe_string = new static(); $safe_string->string = $string; return $safe_string; } } $markup = MarkupTrait::create('foo');

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.130.0090.00917.81
8.4.120.0100.00923.86
8.4.110.0110.00622.51
8.4.100.0130.00818.59
8.4.90.0100.01018.87
8.4.80.0050.00320.54
8.4.70.0080.00818.31
8.4.60.0090.01218.92
8.4.50.0140.00918.68
8.4.40.0040.01721.25
8.4.30.0100.01017.66
8.4.20.0100.01018.02
8.4.10.0090.00019.63
8.3.260.0120.00816.53
8.3.250.0100.00918.68
8.3.240.0090.00917.19
8.3.230.0120.00816.48
8.3.220.0100.00918.79
8.3.210.0110.01016.54
8.3.200.0060.00216.55
8.3.190.0110.00818.84
8.3.180.0100.00817.00
8.3.170.0110.00720.59
8.3.160.0100.00717.27
8.3.150.0120.00816.52
8.3.140.0080.00017.13
8.3.130.0120.00416.57
8.3.120.0030.00720.47
8.3.110.0080.00016.79
8.3.100.0070.00018.60
8.3.90.0060.00326.77
8.3.80.0060.00318.55
8.3.70.0090.00616.75
8.3.60.0120.00918.56
8.3.50.0140.00922.89
8.3.40.0140.00718.88
8.3.30.0090.00918.71
8.3.20.0090.01220.79
8.3.10.0040.01121.73
8.3.00.0030.00717.97
8.2.290.0100.00820.50
8.2.280.0100.00918.65
8.2.270.0080.00017.30
8.2.260.0050.00316.75
8.2.250.0140.00016.73
8.2.240.0040.00417.05
8.2.230.0040.00420.94
8.2.220.0000.00824.06
8.2.210.0030.00626.77
8.2.200.0090.00018.54
8.2.190.0000.01516.63
8.2.180.0140.00416.63
8.2.170.0000.01522.96
8.2.160.0060.00919.29
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00322.08
8.2.120.0070.00026.35
8.2.110.0050.00520.24
8.2.100.0120.00017.90
8.2.90.0030.00519.23
8.2.80.0040.00418.10
8.2.70.0000.00817.63
8.2.60.0090.00017.80
8.2.50.0080.00018.10
8.2.40.0000.00820.47
8.2.30.0040.00419.07
8.2.20.0080.00017.67
8.2.10.0000.00717.97
8.2.00.0000.00818.05
8.1.330.0110.00721.96
8.1.320.0120.00816.33
8.1.310.0000.00818.38
8.1.300.0130.00618.63
8.1.290.0050.00530.84
8.1.280.0110.00425.92
8.1.270.0050.00323.83
8.1.260.0000.00828.09
8.1.250.0000.00828.09
8.1.240.0000.00823.98
8.1.230.0100.00017.77
8.1.220.0030.00517.74
8.1.210.0000.00918.77
8.1.200.0030.00717.35
8.1.190.0000.00719.03
8.1.180.0030.00618.10
8.1.170.0040.00418.57
8.1.160.0070.00022.19
8.1.150.0000.00718.74
8.1.140.0040.00419.51
8.1.130.0000.00717.63
8.1.120.0030.00317.34
8.1.110.0000.00717.42
8.1.100.0020.00517.39
8.1.90.0000.00717.41
8.1.80.0080.00017.28
8.1.70.0030.00517.34
8.1.60.0000.00817.66
8.1.50.0040.00417.53
8.1.40.0090.00017.41
8.1.30.0050.00317.68
8.1.20.0070.00017.69
8.1.10.0030.00517.59
8.1.00.0000.00717.40
8.0.300.0050.00318.77
8.0.290.0070.00016.63
8.0.280.0030.00318.38
8.0.270.0070.00017.18
8.0.260.0030.00317.11
8.0.250.0000.00617.02
8.0.240.0080.00016.87
8.0.230.0040.00416.85
8.0.220.0020.00516.88
8.0.210.0000.00716.84
8.0.200.0000.00616.89
8.0.190.0050.00216.98
8.0.180.0050.00216.98
8.0.170.0000.00816.92
8.0.160.0000.01016.98
8.0.150.0040.00416.73
8.0.140.0000.00916.75
8.0.130.0030.00313.35
8.0.120.0040.00416.91
8.0.110.0040.00416.84
8.0.100.0080.00016.79
8.0.90.0040.00416.77
8.0.80.0100.00316.91
8.0.70.0030.00516.93
8.0.60.0030.00516.77
8.0.50.0000.00817.00
8.0.30.0130.00317.16
8.0.20.0100.00917.40
8.0.10.0040.00416.82
8.0.00.0030.01316.52
7.4.330.0050.00015.13
7.4.320.0000.00616.58
7.4.300.0000.00716.40
7.4.290.0030.00316.64
7.4.280.0000.00816.60
7.4.270.0030.00316.62
7.4.260.0110.00016.50
7.4.250.0040.00416.52
7.4.240.0000.00816.59
7.4.230.0080.00016.70
7.4.220.0180.00016.42
7.4.210.0090.00616.56
7.4.200.0000.00716.69
7.4.160.0120.00916.59
7.4.150.0030.01617.40
7.4.140.0100.00717.86
7.4.130.0080.01316.59
7.4.120.0110.00916.51
7.4.110.0100.01316.64
7.4.100.0130.00316.49
7.4.90.0060.00916.57
7.4.80.0040.01419.39
7.4.70.0160.00016.60
7.4.60.0100.00716.48
7.4.50.0120.00316.25
7.4.40.0090.00616.52
7.4.30.0070.01116.55
7.4.00.0100.00615.01
7.3.330.0030.00313.39
7.3.320.0000.00613.45
7.3.310.0030.00316.45
7.3.300.0000.00716.27
7.3.290.0090.00816.37
7.3.280.0130.00516.39
7.3.270.0060.01317.40
7.3.260.0080.01016.52
7.3.250.0070.01116.36
7.3.240.0110.00916.60
7.3.230.0120.01216.39
7.3.210.0060.01116.66
7.3.200.0100.00716.49
7.3.190.0070.01016.22
7.3.180.0100.00716.59
7.3.170.0160.00716.32
7.3.160.0110.00416.64
7.3.120.0110.00714.81
7.3.110.0060.01314.84
7.3.100.0000.01314.93
7.3.90.0110.00714.71
7.3.80.0040.00714.75
7.3.70.0000.00814.50
7.3.60.0100.00314.88
7.3.50.0030.01014.96
7.3.40.0100.00314.88
7.3.30.0080.00314.73
7.3.20.0030.00616.45
7.3.10.0060.01216.77
7.3.00.0090.00616.67
7.2.330.0140.00416.66
7.2.320.0030.01616.46
7.2.310.0000.01716.62
7.2.300.0070.01416.69
7.2.290.0030.01316.60
7.2.250.0080.01115.03
7.2.240.0070.01314.84
7.2.230.0100.00615.18
7.2.220.0030.00714.91
7.2.210.0060.00615.09
7.2.200.0040.01115.02
7.2.190.0120.00614.98
7.2.180.0070.01115.11
7.2.170.0070.00715.19
7.2.60.0070.00716.75
7.1.330.0030.01515.70
7.1.320.0000.01015.75
7.1.310.0030.01015.43
7.1.300.0100.00715.48
7.1.290.0040.00815.69
7.1.280.0000.00815.85
7.1.270.0040.01115.46
7.1.260.0110.00415.74
7.1.200.0100.00315.76
7.1.70.0040.00417.05
7.1.60.0030.01019.75
7.1.50.0070.00316.64
7.1.00.0070.07022.28
7.0.200.0160.00814.75
7.0.90.0170.05719.96
7.0.80.0170.05020.01
7.0.70.0170.05019.88
7.0.60.0200.06719.84
7.0.50.0170.05720.46
7.0.40.0130.05720.43
7.0.30.0270.04320.39
7.0.20.0130.08320.28
7.0.10.0130.06020.21
7.0.00.0100.06320.33
5.6.240.0070.06020.64
5.6.230.0030.07020.57
5.6.220.0170.05020.71
5.6.210.0130.06720.64
5.6.200.0070.06021.15
5.6.190.0200.06021.09
5.6.180.0070.06321.05
5.6.170.0200.04721.18
5.6.160.0170.05021.05
5.6.150.0100.05721.17
5.6.140.0070.06321.12
5.6.130.0130.05321.08
5.6.120.0230.05321.05
5.6.110.0070.06321.16
5.6.100.0130.06021.09
5.6.90.0130.05721.05
5.6.80.0170.05020.45
5.6.70.0100.07720.46
5.6.60.0100.05320.46
5.6.50.0270.06020.56
5.6.40.0170.05020.41
5.6.30.0200.04020.38
5.6.20.0070.05320.44
5.6.10.0200.05320.44
5.6.00.0130.05720.44

preferences:
127.41 ms | 403 KiB | 5 Q