3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements Countable { public function count(): int { return 3; } } $f = new Foo(); var_dump(count($f)); var_dump(count([$f])); var_dump(count([$f], COUNT_RECURSIVE)); var_dump(count([[1, 2, 3]])); var_dump(count([[1, 2, 3]], COUNT_RECURSIVE));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3GCpt
function name:  (null)
number of ops:  33
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   11     1        NEW                                              $1      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   12     4        INIT_FCALL                                               'var_dump'
          5        COUNT                                            ~4      !0
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   13     8        INIT_FCALL                                               'var_dump'
          9        INIT_ARRAY                                       ~6      !0
         10        COUNT                                            ~7      ~6
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
   14    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'count'
         15        INIT_ARRAY                                       ~9      !0
         16        SEND_VAL                                                 ~9
         17        SEND_VAL                                                 1
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
   15    21        INIT_FCALL                                               'var_dump'
         22        COUNT                                            ~12     <array>
         23        SEND_VAL                                                 ~12
         24        DO_ICALL                                                 
   16    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'count'
         27        SEND_VAL                                                 <array>
         28        SEND_VAL                                                 1
         29        DO_ICALL                                         $14     
         30        SEND_VAR                                                 $14
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Class Foo:
Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3GCpt
function name:  count
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   3
    8     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function count

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.08 ms | 1012 KiB | 15 Q