3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tagWrap(string $tag, string $txt = '', ?callable $func = null): string { $txt = $func ? $func($txt) : $txt; if (!strlen($txt)) { return ''; } return sprintf('<%1$s>%2$s</%1$s>', $tag, $txt); } function underline($txt) { return "<u>$txt</u>"; } echo tagWrap('b', 'make me bold') . "\n"; echo tagWrap('b') . "\n"; echo tagWrap('b', func: fn() => 'sneak this text in') . "\n"; echo tagWrap('i', 'underline me too', "underline") . "\n"; echo tagWrap('i', 'encode \'me\'', "htmlentities") . "\n"; echo tagWrap('i', 'make me italic and quote me', fn($txt) => "&quot;$txt&quot;");

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.5.10.0100.00718.36
8.5.00.0100.01320.19
8.4.160.0140.00823.80
8.4.150.0030.00014.05
8.4.140.0140.00617.61
8.4.130.0120.00717.67
8.4.120.0130.01120.54
8.4.110.0070.00322.81
8.4.100.0150.00717.79
8.4.90.0150.00618.00
8.4.80.0040.00517.82
8.4.70.0170.00517.69
8.4.60.0120.00920.61
8.4.50.0110.01017.62
8.4.40.0070.01417.97
8.4.30.0030.00618.92
8.4.20.0130.00721.20
8.4.10.0090.00019.35
8.3.280.0110.00918.21
8.3.270.0130.00616.63
8.3.260.0110.00916.45
8.3.250.0110.00919.07
8.3.240.0110.00816.50
8.3.230.0130.00616.57
8.3.220.0120.00517.11
8.3.210.0120.00816.72
8.3.200.0110.00816.57
8.3.190.0150.00417.07
8.3.180.0100.00516.46
8.3.170.0100.00720.77
8.3.160.0160.00317.21
8.3.150.0090.00917.16
8.3.140.0130.00316.64
8.3.130.0040.00418.39
8.3.120.0050.00319.03
8.3.110.0080.01120.94
8.3.100.0030.00516.60
8.3.90.0040.00426.77
8.3.80.0090.00017.97
8.3.70.0250.00417.81
8.3.60.0260.00717.81
8.3.50.0000.01117.81
8.3.40.0220.00317.81
8.3.30.0150.01017.81
8.3.20.0240.00817.81
8.3.10.0190.00917.81
8.3.00.0250.00017.81
8.2.290.0140.00920.62
8.2.280.0060.00320.11
8.2.270.0120.00617.56
8.2.260.0040.00416.61
8.2.250.0060.00316.88
8.2.240.0080.00018.88
8.2.230.0030.00622.58
8.2.220.0060.00324.06
8.2.210.0030.00626.77
8.2.200.0090.00016.75
8.2.190.0250.00017.81
8.2.180.0150.00617.81
8.2.170.0240.00017.81
8.2.160.0170.00717.81
8.2.150.0170.00717.81
8.2.140.0210.00317.81
8.2.130.0210.00417.81
8.2.120.0210.00617.81
8.2.110.0190.01017.81
8.2.100.0220.00617.81
8.2.90.0220.00017.81
8.2.80.0190.00317.81
8.2.70.0200.00317.81
8.2.60.0270.00017.81
8.2.50.0150.00917.81
8.2.40.0220.00417.81
8.2.30.0250.00017.81
8.2.20.0210.00417.81
8.2.10.0190.00617.81
8.2.00.0230.00217.81
8.1.330.0130.00717.04
8.1.320.0080.01118.29
8.1.310.0040.00418.24
8.1.300.0060.00317.71
8.1.290.0060.00330.84
8.1.280.0190.00317.81
8.1.270.0160.00817.81
8.1.260.0190.00417.81
8.1.250.0260.00317.81
8.1.240.0300.00017.81
8.1.230.0150.00517.81
8.1.220.0200.00017.81
8.1.210.0160.00517.81
8.1.200.0140.00717.81
8.1.190.0180.00617.81
8.1.180.0160.00517.81
8.1.170.0180.00317.81
8.1.160.0190.00517.81
8.1.150.0190.00317.81
8.1.140.0180.00317.81
8.1.130.0240.00017.81
8.1.120.0200.00517.81
8.1.110.0180.00717.81
8.1.100.0270.00317.81
8.1.90.0190.00317.81
8.1.80.0170.00317.81
8.1.70.0220.00317.81
8.1.60.0200.00717.81
8.1.50.0220.00317.81
8.1.40.0170.00617.81
8.1.30.0210.00417.81
8.1.20.0180.00617.81
8.1.10.0190.00417.81
8.1.00.0150.00517.81

preferences:
80.59 ms | 403 KiB | 5 Q