3v4l.org

run code in 500+ PHP versions simultaneously
<?php function stringifyRequestParamsRecursive(&$array) { foreach ($array as $k => &$v) { if ($k == 'multipart' && is_array($v)) { foreach ($v as $subk => &$subv) { if ( is_array($subv) && !empty($subv['name']) && !empty($subv['contents']) && is_resource($subv['contents']) ) { if ( get_resource_type($subv['contents']) === 'stream' && $metadata = stream_get_meta_data($subv['contents']) && !empty($metadata['uri']) ) { $subv = '@ ' . $metadata['uri']; } } } } } } $a = ['multipart' => [['name' => 'foo', 'contents' => opendir('.')]]]; stringifyRequestParamsRecursive($a); echo json_encode($a, JSON_PRETTY_PRINT);
Output for rfc.property-hooks, git.master, git.master_jit
Warning: opendir(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/cSr1j on line 24 Warning: opendir(.): Failed to open directory: Operation not permitted in /in/cSr1j on line 24 { "multipart": [ { "name": "foo", "contents": false } ] }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.33 ms | 2875 KiB | 4 Q