3v4l.org

run code in 300+ PHP versions simultaneously
<?php $biger_array = array( $a = array("DHL","ACS", "UPS"), $b = array("PayPal", "BrainTree", "UnionPay") ); $sizeof_biger_array = sizeof($biger_array); $array_with_size_of_smaller_arrays = array(); for ($x=0; $x<$sizeof_biger_array; $x++){ //$array_with_size_of_smaller_arrays[] =; $array_with_size_of_smaller_arrays[] = sizeof($biger_array[$x]); } function forLoopDynamic(array $array, array $number_of_vars_in_every_array) { //print 'Inside `aMemberFunc()`'; $sizeOfTheBigerArray = sizeof($array_with_size_of_smaller_arrays); for ($i=0; $i<$sizeOfTheBigerArray; $i++){ echo $number_of_vars_in_every_array[$i]; //for ($x=0; $x<($number_of_vars_in_every_array[$i]); $x++){ //echo $array[$x]; //} } } forLoopDynamic($a, $array_with_size_of_smaller_arrays); //echo $biger_array[0][0]; //echo $biger_array[1][0]; echo sizeof($array_with_size_of_smaller_arrays); //print_R($array_with_size_of_smaller_arrays);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $array_with_size_of_smaller_arrays in /in/lQYCh on line 23 Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, null given in /in/lQYCh:23 Stack trace: #0 /in/lQYCh(39): forLoopDynamic(Array, Array) #1 {main} thrown in /in/lQYCh on line 23
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
61.8 ms | 401 KiB | 8 Q