3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ansiSafeWrapper(string $string, int $max = 80) { return preg_replace( "~(?=(?:(?:\\\\x1b\[[0-9;]+m)?.){{$max}})(?:(?:\\\\x1b\[[0-9;]+m)?.){0,$max}\K ~u", PHP_EOL, str_replace(PHP_EOL, ' ', $string) ); } $test = <<<'ANSI' Morbi leo risus, \x1b[34;1mporta ac consectetur\x1b[39;22m ac, vestibulum at eros. Aenean lacinia bibendum nulla sed consectetur. Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean lacinia bibendum nulla sed consectetur. Curabitur blandit tempus porttitor. ANSI; echo ansiSafeWrapper($test);

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.69
8.4.130.0120.00518.79
8.4.120.0110.00919.70
8.4.110.0050.00524.15
8.4.100.0090.00318.19
8.4.90.0120.00820.79
8.4.80.0060.01020.71
8.4.70.0120.00920.47
8.4.60.0080.00420.71
8.4.50.0150.00522.43
8.4.40.0180.00419.75
8.4.30.0000.00920.45
8.4.20.0100.01023.95
8.4.10.0060.00323.90
8.3.270.0110.00817.07
8.3.260.0130.00616.82
8.3.250.0070.00517.00
8.3.240.0140.00716.64
8.3.230.0100.00916.55
8.3.220.0090.00919.05
8.3.210.0120.00216.95
8.3.200.0060.00316.80
8.3.190.0070.00517.19
8.3.180.0110.00918.92
8.3.170.0070.01117.17
8.3.160.0070.01118.75
8.3.150.0090.00916.82
8.3.140.0050.00316.93
8.3.130.0040.00418.48
8.3.120.0060.00318.90
8.3.110.0080.00020.94
8.3.100.0080.00024.06
8.3.90.0110.00416.78
8.3.80.0000.01017.97
8.3.70.0070.01016.38
8.3.60.0090.00616.75
8.3.50.0150.00016.76
8.3.40.0070.00720.09
8.3.30.0090.00618.98
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0100.00916.89
8.2.280.0080.00218.57
8.2.270.0120.00616.96
8.2.260.0070.01117.09
8.2.250.0100.00018.41
8.2.240.0190.00017.13
8.2.230.0000.00922.58
8.2.220.0000.01037.54
8.2.210.0180.00026.77
8.2.200.0040.00416.88
8.2.190.0120.00618.66
8.2.180.0180.00418.79
8.2.170.0110.00418.98
8.2.160.0000.01422.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00519.77
8.2.110.0070.00322.38
8.2.100.0090.00318.16
8.2.90.0000.00818.00
8.2.80.0050.00319.16
8.2.70.0060.00318.00
8.2.60.0000.00817.88
8.2.50.0040.00418.00
8.2.40.0030.00617.88
8.2.30.0180.00017.88
8.2.20.0140.00617.63
8.2.10.0090.00917.74
8.2.00.0130.00717.88
8.1.330.0100.01016.41
8.1.320.0100.00816.38
8.1.310.0110.00718.38
8.1.300.0030.01618.30
8.1.290.0030.00618.88
8.1.280.0090.00625.92
8.1.270.0060.00323.91
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0000.01023.96
8.1.230.0090.00321.07
8.1.220.0000.00817.77
8.1.210.0080.00019.16
8.1.200.0030.00617.48
8.1.190.0030.00617.48
8.1.180.0000.00818.10
8.1.170.0140.00417.62
8.1.160.0170.00017.62
8.1.150.0140.00417.62
8.1.140.0110.00717.62
8.1.130.0100.01017.62
8.1.120.0200.00017.62
8.1.110.0170.00317.62
8.1.100.0070.01217.62
8.1.90.0090.00917.62
8.1.80.0190.00317.62
8.1.70.0050.01417.62
8.1.60.0150.00517.62
8.1.50.0080.00817.62
8.1.40.0170.00017.63
8.1.30.0190.00017.73
8.1.20.0150.00317.62
8.1.10.0140.00617.62
8.1.00.0110.00717.75
8.0.300.0030.00620.02
8.0.290.0080.00016.88
8.0.280.0160.00317.62
8.0.270.0150.00817.62
8.0.260.0120.00417.62
8.0.250.0150.00517.62
8.0.240.0140.00417.62
8.0.230.0140.00517.62
8.0.220.0070.01117.62
8.0.210.0050.01117.62
8.0.200.0160.00417.62
8.0.190.0200.00017.62
8.0.180.0000.01417.62
8.0.170.0140.00717.62
8.0.160.0150.00517.62
8.0.150.0120.00617.62
8.0.140.0080.00817.62
8.0.130.0160.00017.62
8.0.120.0100.00617.62
8.0.110.0100.00717.62
8.0.100.0130.00717.62
8.0.90.0140.00517.62
8.0.80.0120.00417.62
8.0.70.0100.01017.62
8.0.60.0060.01217.62
8.0.50.0090.00617.62
8.0.30.0040.00717.62
8.0.20.0110.00517.62
8.0.10.0130.00317.62

preferences:
34.07 ms | 403 KiB | 5 Q