3v4l.org

run code in 300+ PHP versions simultaneously
// Source - https://stackoverflow.com/q/79908777 // Posted by Sarah // Retrieved 2026-03-16, License - CC BY-SA 4.0 <?php $myString = "\x65\x92"; $isValidEncoding = mb_check_encoding($myString, 'UTF-8'); if(!$isValidEncoding){ //This code does successfully execute //since the string is not utf-8 encoding. echo "Invalid Encoding!"; } ?>

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.30.0270.00516.58
8.5.20.0290.01016.34
8.5.10.0330.00816.32
8.5.00.0400.00816.43
8.4.180.0320.00419.63
8.4.170.0140.00619.56
8.4.160.0220.00819.50
8.4.150.0130.01019.39
8.4.140.0270.00517.60
8.4.130.0260.00917.43
8.4.120.0210.00817.65
8.4.110.0200.00917.52
8.4.100.0300.00417.74
8.4.90.0290.00917.81
8.4.80.0370.00917.90
8.4.70.0360.00617.44
8.4.60.0200.00217.65
8.4.50.0400.01317.76
8.4.40.0400.01117.51
8.4.30.0400.01017.54
8.4.20.0240.00817.84
8.4.10.0240.00717.74
8.3.300.0310.00618.06
8.3.290.0330.00818.40
8.3.280.0250.00918.18
8.3.270.0310.00916.37
8.3.260.0320.00616.68
8.3.250.0310.01216.66
8.3.240.0370.00716.68
8.3.230.0260.01316.63
8.3.220.0240.00816.62
8.3.210.0180.00316.69
8.3.200.0190.00516.63
8.3.190.0280.00216.68
8.3.180.0180.00216.63
8.3.170.0170.00416.64
8.3.160.0160.00516.61
8.3.150.0230.00616.41
8.3.140.0160.00416.66
8.3.130.0190.00216.55
8.3.120.0170.00216.63
8.3.110.0180.00316.70
8.3.100.0280.01016.70
8.3.90.0220.00316.64
8.3.80.0370.00616.60
8.3.70.0240.00416.57
8.3.60.0190.00416.59
8.3.50.0350.00616.64
8.3.40.0370.00417.84
8.3.30.0290.00717.85
8.3.20.0290.01117.85
8.3.10.0220.00617.91
8.3.00.0310.00517.89

preferences:
51.13 ms | 705 KiB | 5 Q