3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <!DOCTYPE root [ <!ENTITY attack SYSTEM "config/config.ini"> <!ENTITY ent SYSTEM "entities/ent.txt"> ]> <xml> &attack; &ent; </xml> XML; // emulate existing local file mkdir('/tmp/entities/'); file_put_contents('/tmp/entities/ent.txt', 'OK ENTITY'); libxml_set_external_entity_loader( function (?string $public, ?string $system, array $context) { $path = realpath('/tmp' . $system); if ($public === null && $path !== null && str_starts_with($path, '/tmp/entities/')) { $resolved = file_get_contents('/tmp' . $system); } else { $resolved = 'nice try but no'; } $f = fopen('php://temp', 'r+'); fwrite($f, $resolved); rewind($f); return $f; } ); $doc = new DOMDocument; $doc->loadXML($xml, LIBXML_NOENT); echo $doc->saveXML(); ?>

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.120.0100.00820.85
8.4.110.0130.00722.48
8.4.100.0080.00518.28
8.4.90.0090.01117.94
8.4.80.0100.01122.76
8.4.70.0050.00519.88
8.4.60.0120.00918.66
8.4.50.0110.00819.08
8.4.40.0130.00718.75
8.4.30.0130.00620.86
8.4.20.0130.00619.90
8.4.10.0080.00019.66
8.3.250.0130.00619.02
8.3.240.0050.00417.17
8.3.230.0100.01016.94
8.3.220.0100.00917.63
8.3.210.0110.00916.95
8.3.200.0070.00216.86
8.3.190.0140.00717.39
8.3.180.0090.01017.60
8.3.170.0160.00319.29
8.3.160.0130.00716.95
8.3.150.0060.00317.53
8.3.140.0150.00417.00
8.3.130.0040.00418.70
8.3.120.0060.01319.05
8.3.110.0060.00320.94
8.3.100.0000.01124.06
8.3.90.0000.00926.77
8.3.80.0170.00424.40
8.3.70.0150.00924.70
8.3.60.0340.00727.56
8.3.50.0150.00627.56
8.3.40.0360.00827.56
8.3.30.0380.00727.56
8.3.20.0280.00927.56
8.3.10.0350.00527.56
8.3.00.0270.00727.56
8.2.290.0080.00120.74
8.2.280.0080.00717.20
8.2.270.0130.00617.61
8.2.260.0030.00619.24
8.2.250.0040.00417.21
8.2.240.0090.00617.35
8.2.230.0030.01322.58
8.2.220.0040.00437.54
8.2.210.0080.00026.77
8.2.200.0100.00623.86
8.2.190.0150.00623.86
8.2.180.0310.00927.56
8.2.170.0400.00727.56
8.2.160.0280.00527.56
8.2.150.0260.00627.56
8.2.140.0300.00327.56
8.2.130.0310.00527.56
8.2.120.0310.00627.56
8.2.110.0350.00627.56
8.2.100.0330.00627.56
8.2.90.0280.00927.56
8.2.80.0330.00627.56
8.2.70.0320.00827.56
8.2.60.0250.01027.56
8.2.50.0310.00927.56
8.2.40.0260.01127.56
8.2.30.0320.00727.56
8.2.20.0350.00627.56
8.2.10.0300.00827.56
8.2.00.0250.00927.56
8.1.330.0150.00416.55
8.1.320.0150.00516.48
8.1.310.0060.00318.31
8.1.300.0150.00416.77
8.1.290.0140.00430.84
8.1.280.0280.00927.56
8.1.270.0340.00527.56
8.1.260.0300.01027.56
8.1.250.0370.00727.56
8.1.240.0240.00827.56
8.1.230.0220.00927.56
8.1.220.0190.01027.56
8.1.210.0280.00327.56
8.1.200.0290.00527.56
8.1.190.0360.00627.56
8.1.180.0310.00227.56
8.1.170.0280.00627.56
8.1.160.0310.00427.56
8.1.150.0290.00527.56
8.1.140.0270.00827.56
8.1.130.0280.00627.56
8.1.120.0220.00627.56
8.1.110.0200.01027.56
8.1.100.0270.00527.56
8.1.90.0260.00627.56
8.1.80.0260.00827.56
8.1.70.0290.00627.56
8.1.60.0250.01227.56
8.1.50.0300.00827.56
8.1.40.0310.00627.56
8.1.30.0380.00227.56
8.1.20.0290.00927.56
8.1.10.0280.00627.56
8.1.00.0290.00827.56
7.4.330.0180.01230.84

preferences:
29.93 ms | 403 KiB | 5 Q