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
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/vs45L
function name:  (null)
number of ops:  22
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      > JMPZ_EX                                          ~9      ~9, ->19
         16    >   COUNT                                            ~10     !0
         17        IS_EQUAL                                         ~11     ~10, 4
         18        BOOL                                             ~9      ~11
         19    >   SEND_VAL                                                 ~9
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Foo:
Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vs45L
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:
156.85 ms | 1395 KiB | 15 Q