3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fo = new \SplFileObject('import_mmt_20140701.csv', 'r'); $processedBrands = []; $processedModels = []; $lastBrand = ''; foreach ($fo as $line) { isset($i) ? ++$i : $i = 0; if ($i === 0) continue; if (empty($line)) continue; // Countries (assume country names are already converted to the correct ones): list($countryName, $description, $name) = str_getcsv($line, ';'); $countryName = trim($countryName); $description = trim($description); $name = trim($name); if (!in_array($name, $processedBrands) && !empty($countryName) && !empty($name)) { save_brand([ 'status' => 1, 'country' => $countryName, 'countryId' => item_country($countryName), 'reference' => str_url($name), 'name' => $name, 'description' => $description ]); $processedBrands[] = $name; } }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught RuntimeException: SplFileObject::__construct(): open_basedir restriction in effect. File(import_mmt_20140701.csv) is not within the allowed path(s): (/tmp:/in:/etc) in /in/MJ6GM:2 Stack trace: #0 /in/MJ6GM(2): SplFileObject->__construct('import_mmt_2014...', 'r') #1 {main} thrown in /in/MJ6GM on line 2
Process exited with code 255.

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:
49.81 ms | 401 KiB | 8 Q