3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // $array = ['Prinsha', 'Jypsy']; // echo $array[0]; // index is 0 // foreach($model as $key => $data) { // } // $array[1] = 'data'; // $array = ['model' => $model]; // $array = array(); // date('Y-m-d', strtotime("+3 days", $time)); $array = [1, 2, 3, 4]; echo $array[0] . "\n"; $associative = ['a' => 1, 'apple' => '3v4l', '1337' => 'PHP sucks']; echo $associative['a'] . "\n"; echo $associative['apple'] . "\n"; echo $associative[1337] . "\n"; $numbers = [1,2,3,4]; $numbers[] = 5; $numbers[] = 6; echo $numbers[0] . "\n"; //1 echo $numbers[4] . "\n"; // echo $numbers[5] . "\n"; $favColors = array(); $favColors[] = 'BlanchedAlmond'; $favColors[] = 'CadetBlue'; $favColors[] = 'BurlyWood'; $favColors[] = 'DarkOliveGreen'; $favColors[] = 'HotPink'; $favColors[] = 'Papayawhip'; echo $favColors[0];
based on EMS8m
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
1 1 3v4l PHP sucks 1 5 6 BlanchedAlmond