3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // version started by 1.0.1.1 // version is set by 1.1.1.1 // | | | | // | | | -- build number 'build' // | | ---- patch level 'patch' // | ------ minor release 'minor' // -------- major release 'major' $version = []; $version[] = ['major' => 'history1']; $version[] = ['minor' => 'history2']; $version[] = ['patch' => 'history3']; $version[] = ['build' => 'history4']; $major = 1; $minor = 0; $patch = 1; $build = 1; foreach ($version as $versionInfo) { echo $versionInfo; } var_dump($version);
based on VvX9f
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0beta1
Notice: Array to string conversion in /in/5k71Z on line 21 Array Notice: Array to string conversion in /in/5k71Z on line 21 Array Notice: Array to string conversion in /in/5k71Z on line 21 Array Notice: Array to string conversion in /in/5k71Z on line 21 Arrayarray(4) { [0]=> array(1) { ["major"]=> string(8) "history1" } [1]=> array(1) { ["minor"]=> string(8) "history2" } [2]=> array(1) { ["patch"]=> string(8) "history3" } [3]=> array(1) { ["build"]=> string(8) "history4" } }