3v4l.org

run code in 300+ PHP versions simultaneously
<?php $flat = ['a', 'b', 'c']; $treeish = ['a', 'b' => ['x', 'y', 'z'], 'c']; $treeish2 = ['b' => ['x']]; echo 'count($flat): ' . count($flat) . PHP_EOL; echo 'count($flat, 1): ' . count($flat, 1) . PHP_EOL; echo 'count($treeish): ' . count($treeish) . PHP_EOL; echo 'count($treeish, 1): ' . count($treeish, 1) . PHP_EOL; echo count($treeish2, 1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mOMHT
function name:  (null)
number of ops:  31
compiled vars:  !0 = $flat, !1 = $treeish, !2 = $treeish2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    7     3        COUNT                                            ~6      !0
          4        CONCAT                                           ~7      'count%28%24flat%29%3A+', ~6
          5        CONCAT                                           ~8      ~7, '%0A'
          6        ECHO                                                     ~8
    8     7        INIT_FCALL                                               'count'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $9      
         11        CONCAT                                           ~10     'count%28%24flat%2C+1%29%3A+', $9
         12        CONCAT                                           ~11     ~10, '%0A'
         13        ECHO                                                     ~11
    9    14        COUNT                                            ~12     !1
         15        CONCAT                                           ~13     'count%28%24treeish%29%3A+', ~12
         16        CONCAT                                           ~14     ~13, '%0A'
         17        ECHO                                                     ~14
   10    18        INIT_FCALL                                               'count'
         19        SEND_VAR                                                 !1
         20        SEND_VAL                                                 1
         21        DO_ICALL                                         $15     
         22        CONCAT                                           ~16     'count%28%24treeish%2C+1%29%3A+', $15
         23        CONCAT                                           ~17     ~16, '%0A'
         24        ECHO                                                     ~17
   12    25        INIT_FCALL                                               'count'
         26        SEND_VAR                                                 !2
         27        SEND_VAL                                                 1
         28        DO_ICALL                                         $18     
         29        ECHO                                                     $18
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150 ms | 1395 KiB | 15 Q