3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arrCSV = array(); //if (($handle = fopen("http://ichart.finance.yahoo.com/table.csv?s=AAPL&d=7&e=7&f=2012&g=d&a=8&b=7&c=1984&ignore=.csv", "r")) !==FALSE) if (($handle = fopen("http://ichart.finance.yahoo.com/table.csv?s=AAPL", "r")) !==FALSE) { $key = 0; while (($data = fgetcsv($handle, 0, ",")) !==FALSE) { //echo '<br/>======<br/>'; //print_r($data); $c = count($data); If ($key != 0) { $arrCSV[$key-1][0] = strtotime($data[0])*1000; //Time $arrCSV[$key-1][1] = floatval($data[1]); //Open $arrCSV[$key-1][2] = floatval($data[2]); //High $arrCSV[$key-1][3] = floatval($data[3]); //Low $arrCSV[$key-1][4] = floatval($data[6]); //Adj Close $arrCSV[$key-1][5] = floatval($data[5]); //Volume } //echo '<Br/>'; //print_r($arrCSV[$key-1]); $key++; } // end while $keymax = $key; fclose($handle); } // end if echo json_encode($arrCSV); ?>
Output for 5.2.6 - 7.1.0
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DQj2W on line 5 []
Output for 5.2.0 - 5.2.5
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: Connection refused in /in/DQj2W on line 5 []
Output for 5.0.3 - 5.1.6
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: Connection refused in /in/DQj2W on line 5 Fatal error: Call to undefined function json_encode() in /in/DQj2W on line 34
Process exited with code 255.
Output for 5.0.1 - 5.0.2
Warning: fopen(): php_network_getaddresses: gethostbyname failed in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: Success in /in/DQj2W on line 5 Fatal error: Call to undefined function json_encode() in /in/DQj2W on line 34
Process exited with code 255.
Output for 5.0.0
Warning: fopen(): php_network_getaddresses: gethostbyname failed in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: Bad file descriptor in /in/DQj2W on line 5 Fatal error: Call to undefined function json_encode() in /in/DQj2W on line 34
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: Connection refused in /in/DQj2W on line 5 Fatal error: Call to undefined function: json_encode() in /in/DQj2W on line 34
Process exited with code 255.
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.4.4
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: Connection refused in /in/DQj2W on line 5 Fatal error: Call to undefined function: json_encode() in /in/DQj2W on line 34
Process exited with code 255.
Output for 4.3.5 - 4.3.9
Warning: fopen(): php_network_getaddresses: gethostbyname failed in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: Success in /in/DQj2W on line 5 Fatal error: Call to undefined function: json_encode() in /in/DQj2W on line 34
Process exited with code 255.
Output for 4.3.2
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL): failed to open stream: Connection refused in /in/DQj2W on line 5 Fatal error: Call to undefined function: json_encode() in /in/DQj2W on line 34
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: fopen() [http://www.php.net/function.fopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DQj2W on line 5 Warning: fopen(http://ichart.finance.yahoo.com/table.csv?s=AAPL) [http://www.php.net/function.fopen]: failed to create stream: Connection refused in /in/DQj2W on line 5 Fatal error: Call to undefined function: json_encode() in /in/DQj2W on line 34