3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public $cl; function __construct($cl) { $this->cl = $cl; } function isEqualls(a $i) { if (get_class($this) === get_class($i)) { if ($this->cl === $i->cl) { return true; } } return false; } } $cl = function($data) {return $data += $data;}; $cl2 = function(){return 'my_closure';}; $a = new a($cl); $i = new a($cl2); var_dump($a->isEquals($i)); $a = new a($cl); $i = new a($cl); var_dump($a->isEquals($i));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Znofc
function name:  (null)
number of ops:  33
compiled vars:  !0 = $cl, !1 = $cl2, !2 = $a, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZnofc%3A26%240'
          1        ASSIGN                                                   !0, ~4
   28     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZnofc%3A28%241'
          3        ASSIGN                                                   !1, ~6
   31     4        NEW                                              $8      'a'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $8
   32     8        NEW                                              $11     'a'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $11
   35    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !2, 'isEquals'
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0  $14     
         16        SEND_VAR                                                 $14
         17        DO_ICALL                                                 
   37    18        NEW                                              $16     'a'
         19        SEND_VAR_EX                                              !0
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !2, $16
   38    22        NEW                                              $19     'a'
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !3, $19
   41    26        INIT_FCALL                                               'var_dump'
         27        INIT_METHOD_CALL                                         !2, 'isEquals'
         28        SEND_VAR_EX                                              !3
         29        DO_FCALL                                      0  $22     
         30        SEND_VAR                                                 $22
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZnofc%3A26%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Znofc
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        ASSIGN_OP                                     1  ~1      !0, !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZnofc%3A26%240

Function %00%7Bclosure%7D%2Fin%2FZnofc%3A28%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Znofc
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                   'my_closure'
          1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZnofc%3A28%241

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

End of function __construct

Function isequalls:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/Znofc
function name:  isEqualls
number of ops:  13
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        FETCH_THIS                                       ~1      
          2        GET_CLASS                                        ~2      ~1
          3        GET_CLASS                                        ~3      !0
          4        IS_IDENTICAL                                             ~2, ~3
          5      > JMPZ                                                     ~4, ->11
   17     6    >   FETCH_OBJ_R                                      ~5      'cl'
          7        FETCH_OBJ_R                                      ~6      !0, 'cl'
          8        IS_IDENTICAL                                             ~5, ~6
          9      > JMPZ                                                     ~7, ->11
   19    10    > > RETURN                                                   <true>
   22    11    > > RETURN                                                   <false>
   23    12*     > RETURN                                                   null

End of function isequalls

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.65 ms | 1392 KiB | 15 Q