3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 2; $count = new class($value) implements Countable { public function __construct($value) { $this->value = $value; } public function count() { return strlen($this->value); } }; echo count($count);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S28K7
function name:  (null)
number of ops:  9
compiled vars:  !0 = $value, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 2
    4     1        DECLARE_ANON_CLASS                               <unknown> 
          2        NEW                                              $4      $3
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
   17     6        COUNT                                            ~7      !1
          7        ECHO                                                     ~7
          8      > RETURN                                                   1

Class Countable@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S28K7
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S28K7
function name:  count
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1        STRLEN                                           ~1      ~0
          2      > RETURN                                                   ~1
   14     3*     > RETURN                                                   null

End of function count

End of class Countable@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.52 ms | 1423 KiB | 13 Q