3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(count(null)); var_dump(count(0)); class Foo implements Countable { public function count() { return 4; } } $foo = new Foo; var_dump(!is_array($foo), 4 == count($foo));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sDrI9
function name:  (null)
number of ops:  21
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        COUNT                                            ~1      null
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'var_dump'
          5        COUNT                                            ~3      0
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
    6     8        DECLARE_CLASS                                            'foo'
   13     9        NEW                                              $5      'Foo'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !0, $5
   14    12        INIT_FCALL                                               'var_dump'
         13        TYPE_CHECK                                  128  ~8      !0
         14        BOOL_NOT                                         ~9      ~8
         15        SEND_VAL                                                 ~9
         16        COUNT                                            ~10     !0
         17        IS_EQUAL                                         ~11     ~10, 4
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

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

End of function count

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.42 ms | 1400 KiB | 15 Q