3v4l.org

run code in 500+ PHP versions simultaneously
<?php $rooms = array ( 'The Lounge' => array ( 'id' => 1, 'privacy' => 'public', 'users' => array ( 'QUICHE POIREAU' => array ( 'smiley' => 'smi_smile.gif', 'name' => 'QUICHEPOIREAU', 'state' => NULL, 'id' => 1 ), 'JOHN DOE' => array ( 'smiley' => 'smi_smile.gif', 'name' => 'JoeFRANC', 'id' => 40 ), ) ), 'The Beach' => array ( 'id' => 2, 'privacy' => 'public', 'users' => array ( Null => array ( 'smiley' => Null, 'name' => Null, 'state' => Null, 'id' => Null ), ), ) ); foreach ($rooms as $name => $room) { $users = count(array_filter(array_keys($room['users']))); echo "$name: $users users\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 25
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/qjC0j
function name:  (null)
number of ops:  27
compiled vars:  !0 = $rooms, !1 = $room, !2 = $name, !3 = $users
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   INIT_ARRAY                                           ~4      <array>, 'The+Lounge'
   27     1        INIT_ARRAY                                           ~5      2, 'id'
   28     2        ADD_ARRAY_ELEMENT                                    ~5      'public', 'privacy'
    6     3        INIT_ARRAY                                           ~6      <array>, null
          4        ADD_ARRAY_ELEMENT                                    ~5      ~6, 'users'
          5        ADD_ARRAY_ELEMENT                                    ~4      ~5, 'The+Beach'
    3     6        ASSIGN                                                       !0, ~4
   45     7      > FE_RESET_R                                           $8      !0, ->25
          8    > > FE_FETCH_R                                           ~9      $8, !1, ->25
          9    >   ASSIGN                                                       !2, ~9
   46    10        INIT_FCALL                                                   'array_filter'
         11        INIT_FCALL                                                   'array_keys'
         12        FETCH_DIM_R                                          ~11     !1, 'users'
         13        SEND_VAL                                                     ~11
         14        DO_ICALL                                             $12     
         15        SEND_VAR                                                     $12
         16        DO_ICALL                                             $13     
         17        COUNT                                                ~14     $13
         18        ASSIGN                                                       !3, ~14
   47    19        ROPE_INIT                                         4  ~17     !2
         20        ROPE_ADD                                          1  ~17     ~17, '%3A+'
         21        ROPE_ADD                                          2  ~17     ~17, !3
         22        ROPE_END                                          3  ~16     ~17, '+users%0A'
         23        ECHO                                                         ~16
   45    24      > JMP                                                          ->8
         25    >   FE_FREE                                                      $8
   48    26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.87 ms | 1976 KiB | 15 Q