3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: fopen(): php_network_getaddresses: getaddrinfo for ichart.finance.yahoo.com failed: System error 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 for ichart.finance.yahoo.com failed: System error in /in/DQj2W on line 5 []
Output for 8.0.13 - 8.0.30
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: System error 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: System error in /in/DQj2W on line 5 []
Output for 8.0.0 - 8.0.12
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution 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: Temporary failure in name resolution in /in/DQj2W on line 5 []
Output for 7.0.20, 7.1.5 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.3.32 - 7.3.33, 7.4.0, 7.4.26 - 7.4.33
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: System error 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: System error in /in/DQj2W on line 5 []
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.25
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution 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: Temporary failure in name resolution in /in/DQj2W on line 5 []
Output for 5.2.6 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.14, 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.0.5, 5.1.0 - 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.3.11, 4.4.0 - 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

preferences:
250.06 ms | 402 KiB | 396 Q