3v4l.org

run code in 300+ PHP versions simultaneously
<?php $examples = array( 'Valid ASCII' => "a", 'Valid 2 Octet Sequence' => "\xc3\xb1", 'Invalid 2 Octet Sequence' => "\xc3\x28", 'Invalid Sequence Identifier' => "\xa0\xa1", 'Valid 3 Octet Sequence' => "\xe2\x82\xa1", 'Invalid 3 Octet Sequence (in 2nd Octet)' => "\xe2\x28\xa1", 'Invalid 3 Octet Sequence (in 3rd Octet)' => "\xe2\x82\x28", 'Valid 4 Octet Sequence' => "\xf0\x90\x8c\xbc", 'Invalid 4 Octet Sequence (in 2nd Octet)' => "\xf0\x28\x8c\xbc", 'Invalid 4 Octet Sequence (in 3rd Octet)' => "\xf0\x90\x28\xbc", 'Invalid 4 Octet Sequence (in 4th Octet)' => "\xf0\x28\x8c\x28", 'Valid 5 Octet Sequence (but not Unicode!)' => "\xf8\xa1\xa1\xa1\xa1", 'Valid 6 Octet Sequence (but not Unicode!)' => "\xfc\xa1\xa1\xa1\xa1\xa1", ); mb_substitute_character(0xFFFD); foreach ($examples as $k => $v) { echo "{$k}\n"; echo mb_convert_encoding($v, 'utf-8', 'utf-8); echo "\n"; }

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)
5.4.220.0100.04712.38
5.4.210.0120.04712.38
5.4.200.0120.06312.38
5.4.190.0120.04512.38
5.4.180.0140.04412.38
5.4.170.0120.04712.38
5.4.160.0160.06312.38
5.4.150.0100.05812.38
5.4.140.0120.04612.07
5.4.130.0140.04412.05
5.4.120.0120.04712.01
5.4.110.0120.04512.01
5.4.100.0160.07312.01
5.4.90.0120.04712.01
5.4.80.0090.04912.01
5.4.70.0120.04512.00
5.4.60.0100.05212.01
5.4.50.0130.04112.01
5.4.40.0130.04612.00
5.4.30.0130.04511.99
5.4.20.0240.06611.98
5.4.10.0130.04311.99
5.4.00.0110.04611.48
5.3.270.0130.05012.72
5.3.260.0140.04912.72
5.3.250.0130.04512.72
5.3.240.0150.07512.72
5.3.230.0150.04512.71
5.3.220.0150.04412.68
5.3.210.0120.04712.68
5.3.200.0140.04412.68
5.3.190.0160.05012.68
5.3.180.0130.04912.67
5.3.170.0130.04212.67
5.3.160.0090.04612.67
5.3.150.0130.04312.67
5.3.140.0120.04512.66
5.3.130.0130.04212.66
5.3.120.0110.04712.66
5.3.110.0150.04512.66
5.3.100.0180.06812.12
5.3.90.0120.04312.08
5.3.80.0090.04512.08
5.3.70.0090.04612.07
5.3.60.0150.05312.06
5.3.50.0090.04512.00
5.3.40.0150.03812.00
5.3.30.0110.04511.95
5.3.20.0140.04311.72
5.3.10.0150.05711.69
5.3.00.0120.04611.67

preferences:
141.09 ms | 1394 KiB | 7 Q