3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<? // Make array of URLs to work with $URLs = array( 'http://zonzoo.nl/uw-telefoons-verkopen/1023/Apple+iPhone+4+16GB', 'http://zonzoo.nl/uw-telefoons-verkopen/1024/Apple+iPhone+4+32GB', 'http://zonzoo.nl/uw-telefoons-verkopen/1272/Apple+iPhone+4+8GB' ); // Loop through each array and store the prices in arrays foreach ($URLs as $URL) { $working[] = do_shortcode('[wpwg url="' . $URL . '" selector=".price-quote.working dd" cache="0" rem_tags="script, style" newtab="false"]'); $not_working[] = do_shortcode('[wpwg url="' . $URL . '" selector=".price-quote.not_working dd" cache="0" rem_tags="script, style" newtab="false"]'); } // Open the file "zonzoo.csv" for writing $file = fopen('zonzoo.csv', 'w'); // Save the column headers fputcsv($file, array('ID', 'NAME', 'CATEGORY', 'BRAND', 'PRICE', 'DEEPLINK', 'IMAGE', 'SHIPPING')); // Sample data. This can be fetched from MySQL too $data = array ( array(1, 'iPhone 4 16GB', 'Mobiel', 'Apple', 0, 'http://zonzoo.nl/uw-telefoons-verkopen/1023/Apple+iPhone+4+16GB', 'http://www.fonebank.com/images/uploads/handsets/apple-iphone-4-ofic-final.jpg', 0), array(2, 'iPhone 4 32GB', 'Mobiel', 'Apple', 0, 'http://zonzoo.nl/uw-telefoons-verkopen/1024/Apple+iPhone+4+32GB', 'http://www.fonebank.com/images/uploads/handsets/apple-iphone-4-ofic-final.jpg', 0), array(3, 'iPhone 4 8GB', 'Mobiel', 'Apple', 0, 'http://zonzoo.nl/uw-telefoons-verkopen/1272/Apple+iPhone+4+8GB', 'http://www.fonebank.com/images/uploads/handsets/apple-iphone-4-ofic-final.jpg', 0) ); // Replace the prices of working mobile phones $i = 0; foreach ($working as $price_working) { $data[$i][4] = $price_working; $i++; } // Replace the prices of not-working mobile phones $x = 0; foreach ($not_working as $price_not_working) { $data[$x][7] = $price_not_working; $x++; } // Save each row of the data foreach ($data as $row) { fputcsv($file, $row); } // Close the file fclose($file); ?>
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught Error: Call to undefined function do_shortcode() in /in/KhPNM:12 Stack trace: #0 {main} thrown in /in/KhPNM on line 12
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Call to undefined function do_shortcode() in /in/KhPNM:12 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function do_shortcode() in /in/KhPNM on line 12
Process exited with code 255.