3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Класс Foo */ class Foo { /** @var int Счётчик */ static $counter = 0; /** * Очень хочет сделать Foo и выводит * кучу очень интересной инфы * * @param int $a Первый аргумент * @param int $b Второй аргумент * @return int Сумма аргументов */ public function doFoo($a, $b) { $sum = $a + $b; echo "$a+$b=$sum\n"; return $sum; } /** * Конструктор по-умолчанию выводит количество созданий * объектов класса Foo */ public function __construct() { echo 'Counter: ' . ++self::$counter . PHP_EOL; } } $obj = new Foo(); $obj->doFoo(2,4); new Foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D80RZ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   36     3        INIT_METHOD_CALL                                         !0, 'doFoo'
          4        SEND_VAL_EX                                              2
          5        SEND_VAL_EX                                              4
          6        DO_FCALL                                      0          
   37     7        NEW                                              $5      'Foo'
          8        DO_FCALL                                      0          
          9        FREE                                                     $5
         10      > RETURN                                                   1

Class Foo:
Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D80RZ
function name:  doFoo
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $sum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2        ADD                                              ~3      !0, !1
          3        ASSIGN                                                   !2, ~3
   21     4        ROPE_INIT                                     6  ~6      !0
          5        ROPE_ADD                                      1  ~6      ~6, '%2B'
          6        ROPE_ADD                                      2  ~6      ~6, !1
          7        ROPE_ADD                                      3  ~6      ~6, '%3D'
          8        ROPE_ADD                                      4  ~6      ~6, !2
          9        ROPE_END                                      5  ~5      ~6, '%0A'
         10        ECHO                                                     ~5
   22    11      > RETURN                                                   !2
   23    12*     > RETURN                                                   null

End of function dofoo

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D80RZ
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   PRE_INC_STATIC_PROP                              ~0      'counter'
          1        CONCAT                                           ~1      'Counter%3A+', ~0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   32     4      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.91 ms | 1395 KiB | 13 Q