3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Auto{ private $farba; private $nazov; public function __construct($paFarba, $paNazov){ echo "konstruktor"; $this->farba = $paFarba; $this->nazov = $paNazov; } public function getFarba(){ return $this->farba; } public function getNazov(){ return $this->nazov; } public function __toString(){ return "Auto: {$this->nazov} {$this->farba}"; } public function compareNazov($obj1, $obj2){ return strcmp($obj1->nazov, $obj2->nazov); } public function compareFarba($obj1, $obj2){ return strcmp($obj1->farba, $obj2->farba); } } $cars = array(new Auto("Zlta", "Volvo"), new Auto("Cervena", "Skoda"), new Auto("Zelena", "Octavia")); $car = new Auto("Fialova", "Toyota"); $length = count($cars); for ($i = 0; $i < $length; $i++){ echo $cars[i]; echo "<br>"; } usort($your_data, "compareNazov"); for ($i = 0; $i < $length; $i++){ echo $cars[i]; echo "<br>"; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 26
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 39
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 39
Branch analysis from position: 46
Branch analysis from position: 39
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 26
Branch analysis from position: 33
Branch analysis from position: 26
filename:       /in/M8PVb
function name:  (null)
number of ops:  47
compiled vars:  !0 = $cars, !1 = $car, !2 = $length, !3 = $i, !4 = $your_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'auto'
   35     1        NEW                                              $5      'Auto'
          2        SEND_VAL_EX                                              'Zlta'
          3        SEND_VAL_EX                                              'Volvo'
          4        DO_FCALL                                      0          
          5        INIT_ARRAY                                       ~7      $5
          6        NEW                                              $8      'Auto'
          7        SEND_VAL_EX                                              'Cervena'
          8        SEND_VAL_EX                                              'Skoda'
          9        DO_FCALL                                      0          
         10        ADD_ARRAY_ELEMENT                                ~7      $8
         11        NEW                                              $10     'Auto'
         12        SEND_VAL_EX                                              'Zelena'
         13        SEND_VAL_EX                                              'Octavia'
         14        DO_FCALL                                      0          
         15        ADD_ARRAY_ELEMENT                                ~7      $10
         16        ASSIGN                                                   !0, ~7
   36    17        NEW                                              $13     'Auto'
         18        SEND_VAL_EX                                              'Fialova'
         19        SEND_VAL_EX                                              'Toyota'
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !1, $13
   37    22        COUNT                                            ~16     !0
         23        ASSIGN                                                   !2, ~16
   38    24        ASSIGN                                                   !3, 0
         25      > JMP                                                      ->31
   39    26    >   FETCH_CONSTANT                                   ~19     'i'
         27        FETCH_DIM_R                                      ~20     !0, ~19
         28        ECHO                                                     ~20
   40    29        ECHO                                                     '%3Cbr%3E'
   38    30        PRE_INC                                                  !3
         31    >   IS_SMALLER                                               !3, !2
         32      > JMPNZ                                                    ~22, ->26
   43    33    >   INIT_FCALL                                               'usort'
         34        SEND_REF                                                 !4
         35        SEND_VAL                                                 'compareNazov'
         36        DO_ICALL                                                 
   44    37        ASSIGN                                                   !3, 0
         38      > JMP                                                      ->44
   45    39    >   FETCH_CONSTANT                                   ~25     'i'
         40        FETCH_DIM_R                                      ~26     !0, ~25
         41        ECHO                                                     ~26
   46    42        ECHO                                                     '%3Cbr%3E'
   44    43        PRE_INC                                                  !3
         44    >   IS_SMALLER                                               !3, !2
         45      > JMPNZ                                                    ~28, ->39
   49    46    > > RETURN                                                   1

Class Auto:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M8PVb
function name:  __construct
number of ops:  8
compiled vars:  !0 = $paFarba, !1 = $paNazov
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        ECHO                                                     'konstruktor'
    8     3        ASSIGN_OBJ                                               'farba'
          4        OP_DATA                                                  !0
    9     5        ASSIGN_OBJ                                               'nazov'
          6        OP_DATA                                                  !1
   10     7      > RETURN                                                   null

End of function __construct

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

End of function getfarba

Function getnazov:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M8PVb
function name:  getNazov
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'nazov'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function getnazov

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M8PVb
function name:  __toString
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ROPE_INIT                                     4  ~3      'Auto%3A++'
          1        FETCH_OBJ_R                                      ~0      'nazov'
          2        ROPE_ADD                                      1  ~3      ~3, ~0
          3        ROPE_ADD                                      2  ~3      ~3, '++'
          4        FETCH_OBJ_R                                      ~1      'farba'
          5        ROPE_END                                      3  ~2      ~3, ~1
          6        VERIFY_RETURN_TYPE                                       ~2
          7      > RETURN                                                   ~2
   22     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function __tostring

Function comparenazov:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M8PVb
function name:  compareNazov
number of ops:  10
compiled vars:  !0 = $obj1, !1 = $obj2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   25     2        INIT_FCALL                                               'strcmp'
          3        FETCH_OBJ_R                                      ~2      !0, 'nazov'
          4        SEND_VAL                                                 ~2
          5        FETCH_OBJ_R                                      ~3      !1, 'nazov'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   26     9*     > RETURN                                                   null

End of function comparenazov

Function comparefarba:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M8PVb
function name:  compareFarba
number of ops:  10
compiled vars:  !0 = $obj1, !1 = $obj2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   29     2        INIT_FCALL                                               'strcmp'
          3        FETCH_OBJ_R                                      ~2      !0, 'farba'
          4        SEND_VAL                                                 ~2
          5        FETCH_OBJ_R                                      ~3      !1, 'farba'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   30     9*     > RETURN                                                   null

End of function comparefarba

End of class Auto.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.72 ms | 1396 KiB | 17 Q