3v4l.org

run code in 500+ PHP versions simultaneously
<?php // An indexed array of programming languages $languages = ['PHP', 'JavaScript', 'Python', 'Go']; // Accessing elements by their index echo "The second language is: " . $languages[1] . PHP_EOL; // Index 1 is the second element // To see the whole array structure, use print_r() or var_dump() print_r($languages);
Output for 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.28, 8.5.0 - 8.5.13, 8.6.0
The second language is: JavaScript Array ( [0] => PHP [1] => JavaScript [2] => Python [3] => Go )

preferences:
16.19 ms | 1164 KiB | 6 Q