3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <table style="width: 50%"> <tr> <td><a href="?order=name">Nazov</a></td> <td><a href="?order=model">Model</a></td> <td><a href="?">Naspat</a></td> </tr> <?php /** * Created by PhpStorm. * User: maruna2 * Date: 5.11.2015 * Time: 18:31 */ class Auto { private $nazov; private $model; function __construct($nazov,$model){ $this->model=$model; $this->nazov=$nazov; } function getNazov() { return $this->nazov; } function getModel() { return $this->model; } } function compare($a,$b) { if(isset($_GET["order"])) { if($_GET["order"]=="name") return strcmp($a->getNazov(),$b->getNazov()); if($_GET["order"]=="model") return strcmp($a->getModel(),$b->getModel()); } return 0; } $pole; $pole[] = new Auto("Ford","Escort"); $pole[] = new Auto("Ford","Focus"); $pole[] = new Auto("Skoda","Fabia"); $pole[] = new Auto("Volkswagen","Golf"); $pole[] = new Auto("Chevrolet","Corvette"); usort($pole, "compare"); ?> <?php foreach($pole as $auto) {?> <tr> <td><?php echo $auto->getNazov()?></td> <td><?php echo $auto->getModel()?></td> </tr> <?php } ?> </table> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 48
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 48
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
filename:       /in/lsm96
function name:  (null)
number of ops:  51
compiled vars:  !0 = $pole, !1 = $auto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Chtml%3E%0A%3Chead%3E%0A%0A++++%3Ctitle%3ETODO+supply+a+title%3C%2Ftitle%3E%0A++++%3Cmeta+charset%3D%22UTF-8%22%3E%0A++++%3Cmeta+name%3D%22viewport%22+content%3D%22width%3Ddevice-width%2C+initial-scale%3D1.0%22%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%0A%3Ctable+style%3D%22width%3A+50%25%22%3E%0A++++%3Ctr%3E%0A++++++++%3Ctd%3E%3Ca+href%3D%22%3Forder%3Dname%22%3ENazov%3C%2Fa%3E%3C%2Ftd%3E%0A++++++++%3Ctd%3E%3Ca+href%3D%22%3Forder%3Dmodel%22%3EModel%3C%2Fa%3E%3C%2Ftd%3E%0A++++++++%3Ctd%3E%3Ca+href%3D%22%3F%22%3ENaspat%3C%2Fa%3E%3C%2Ftd%3E%0A++++%3C%2Ftr%3E%0A%0A%0A'
   63     1        NEW                                              $3      'Auto'
          2        SEND_VAL_EX                                              'Ford'
          3        SEND_VAL_EX                                              'Escort'
          4        DO_FCALL                                      0          
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  $3
   64     7        NEW                                              $6      'Auto'
          8        SEND_VAL_EX                                              'Ford'
          9        SEND_VAL_EX                                              'Focus'
         10        DO_FCALL                                      0          
         11        ASSIGN_DIM                                               !0
         12        OP_DATA                                                  $6
   65    13        NEW                                              $9      'Auto'
         14        SEND_VAL_EX                                              'Skoda'
         15        SEND_VAL_EX                                              'Fabia'
         16        DO_FCALL                                      0          
         17        ASSIGN_DIM                                               !0
         18        OP_DATA                                                  $9
   66    19        NEW                                              $12     'Auto'
         20        SEND_VAL_EX                                              'Volkswagen'
         21        SEND_VAL_EX                                              'Golf'
         22        DO_FCALL                                      0          
         23        ASSIGN_DIM                                               !0
         24        OP_DATA                                                  $12
   67    25        NEW                                              $15     'Auto'
         26        SEND_VAL_EX                                              'Chevrolet'
         27        SEND_VAL_EX                                              'Corvette'
         28        DO_FCALL                                      0          
         29        ASSIGN_DIM                                               !0
         30        OP_DATA                                                  $15
   68    31        INIT_FCALL                                               'usort'
         32        SEND_REF                                                 !0
         33        SEND_VAL                                                 'compare'
         34        DO_ICALL                                                 
   70    35        ECHO                                                     '%0A'
   72    36      > FE_RESET_R                                       $18     !0, ->48
         37    > > FE_FETCH_R                                               $18, !1, ->48
   74    38    >   ECHO                                                     '++++%3Ctr%3E%0A++++++++%3Ctd%3E'
   75    39        INIT_METHOD_CALL                                         !1, 'getNazov'
         40        DO_FCALL                                      0  $19     
         41        ECHO                                                     $19
         42        ECHO                                                     '%3C%2Ftd%3E%0A++++++++%3Ctd%3E'
   76    43        INIT_METHOD_CALL                                         !1, 'getModel'
         44        DO_FCALL                                      0  $20     
         45        ECHO                                                     $20
         46        ECHO                                                     '%3C%2Ftd%3E%0A%0A++++%3C%2Ftr%3E%0A'
   72    47      > JMP                                                      ->37
         48    >   FE_FREE                                                  $18
   82    49        ECHO                                                     '%3C%2Ftable%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   84    50      > RETURN                                                   1

Function compare:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 31
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 31
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/lsm96
function name:  compare
number of ops:  33
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   50     2        FETCH_IS                                         ~2      '_GET'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, 'order'
          4      > JMPZ                                                     ~3, ->31
   53     5    >   FETCH_R                      global              ~4      '_GET'
          6        FETCH_DIM_R                                      ~5      ~4, 'order'
          7        IS_EQUAL                                                 ~5, 'name'
          8      > JMPZ                                                     ~6, ->18
   54     9    >   INIT_FCALL                                               'strcmp'
         10        INIT_METHOD_CALL                                         !0, 'getNazov'
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        INIT_METHOD_CALL                                         !1, 'getNazov'
         14        DO_FCALL                                      0  $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                         $9      
         17      > RETURN                                                   $9
   56    18    >   FETCH_R                      global              ~10     '_GET'
         19        FETCH_DIM_R                                      ~11     ~10, 'order'
         20        IS_EQUAL                                                 ~11, 'model'
         21      > JMPZ                                                     ~12, ->31
   57    22    >   INIT_FCALL                                               'strcmp'
         23        INIT_METHOD_CALL                                         !0, 'getModel'
         24        DO_FCALL                                      0  $13     
         25        SEND_VAR                                                 $13
         26        INIT_METHOD_CALL                                         !1, 'getModel'
         27        DO_FCALL                                      0  $14     
         28        SEND_VAR                                                 $14
         29        DO_ICALL                                         $15     
         30      > RETURN                                                   $15
   59    31    > > RETURN                                                   0
   60    32*     > RETURN                                                   null

End of function compare

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

End of function __construct

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

End of function getnazov

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

End of function getmodel

End of class Auto.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.67 ms | 1404 KiB | 17 Q