3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StringContainer { /** @var array */ public $strings = []; /** * @param array $strings */ public function __construct(array $strings) { $this->strings = $strings; } /** * @return array */ public function getStrings() { return $this->strings; } /* * @return bool */ public function isEqual(StringContainer $container) { return $this->strings == $container->getStrings(); } } $cont = new StringContainer(array("a", "bb", "ccc")); $cont2 = new StringContainer(array("z", "yy", "xxx")); echo "first test: "; var_dump($cont->isEqual($cont2)); echo "\n<br/>second test: "; $cont3 = new StringContainer(array("bb", "a", "ccc")); var_dump($cont->isEqual($cont3));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5FfOU
function name:  (null)
number of ops:  27
compiled vars:  !0 = $cont, !1 = $cont2, !2 = $cont3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $3      'StringContainer'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   35     4        NEW                                              $6      'StringContainer'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   37     8        ECHO                                                     'first+test%3A+'
   38     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'isEqual'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $9      
         13        SEND_VAR                                                 $9
         14        DO_ICALL                                                 
   40    15        ECHO                                                     '%0A%3Cbr%2F%3Esecond+test%3A+'
   41    16        NEW                                              $11     'StringContainer'
         17        SEND_VAL_EX                                              <array>
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !2, $11
   42    20        INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !0, 'isEqual'
         22        SEND_VAR_EX                                              !2
         23        DO_FCALL                                      0  $14     
         24        SEND_VAR                                                 $14
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

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

End of function __construct

Function getstrings:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5FfOU
function name:  getStrings
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'strings'
          1      > RETURN                                                   ~0
   22     2*     > RETURN                                                   null

End of function getstrings

Function isequal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5FfOU
function name:  isEqual
number of ops:  7
compiled vars:  !0 = $container
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        FETCH_OBJ_R                                      ~1      'strings'
          2        INIT_METHOD_CALL                                         !0, 'getStrings'
          3        DO_FCALL                                      0  $2      
          4        IS_EQUAL                                         ~3      $2, ~1
          5      > RETURN                                                   ~3
   30     6*     > RETURN                                                   null

End of function isequal

End of class StringContainer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.36 ms | 1400 KiB | 15 Q