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 */ include("Auto.php"); 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 = 38, Position 2 = 49
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 49
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/KqMJM
function name:  (null)
number of ops:  52
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'
   26     1        INCLUDE_OR_EVAL                                          'Auto.php', INCLUDE
   42     2        NEW                                              $4      'Auto'
          3        SEND_VAL_EX                                              'Ford'
          4        SEND_VAL_EX                                              'Escort'
          5        DO_FCALL                                      0          
          6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  $4
   43     8        NEW                                              $7      'Auto'
          9        SEND_VAL_EX                                              'Ford'
         10        SEND_VAL_EX                                              'Focus'
         11        DO_FCALL                                      0          
         12        ASSIGN_DIM                                               !0
         13        OP_DATA                                                  $7
   44    14        NEW                                              $10     'Auto'
         15        SEND_VAL_EX                                              'Skoda'
         16        SEND_VAL_EX                                              'Fabia'
         17        DO_FCALL                                      0          
         18        ASSIGN_DIM                                               !0
         19        OP_DATA                                                  $10
   45    20        NEW                                              $13     'Auto'
         21        SEND_VAL_EX                                              'Volkswagen'
         22        SEND_VAL_EX                                              'Golf'
         23        DO_FCALL                                      0          
         24        ASSIGN_DIM                                               !0
         25        OP_DATA                                                  $13
   46    26        NEW                                              $16     'Auto'
         27        SEND_VAL_EX                                              'Chevrolet'
         28        SEND_VAL_EX                                              'Corvette'
         29        DO_FCALL                                      0          
         30        ASSIGN_DIM                                               !0
         31        OP_DATA                                                  $16
   47    32        INIT_FCALL                                               'usort'
         33        SEND_REF                                                 !0
         34        SEND_VAL                                                 'compare'
         35        DO_ICALL                                                 
   49    36        ECHO                                                     '%0A'
   51    37      > FE_RESET_R                                       $19     !0, ->49
         38    > > FE_FETCH_R                                               $19, !1, ->49
   53    39    >   ECHO                                                     '++++%3Ctr%3E%0A++++++++%3Ctd%3E'
   54    40        INIT_METHOD_CALL                                         !1, 'getNazov'
         41        DO_FCALL                                      0  $20     
         42        ECHO                                                     $20
         43        ECHO                                                     '%3C%2Ftd%3E%0A++++++++%3Ctd%3E'
   55    44        INIT_METHOD_CALL                                         !1, 'getModel'
         45        DO_FCALL                                      0  $21     
         46        ECHO                                                     $21
         47        ECHO                                                     '%3C%2Ftd%3E%0A%0A++++%3C%2Ftr%3E%0A'
   51    48      > JMP                                                      ->38
         49    >   FE_FREE                                                  $19
   61    50        ECHO                                                     '%3C%2Ftable%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   63    51      > 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/KqMJM
function name:  compare
number of ops:  33
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   29     2        FETCH_IS                                         ~2      '_GET'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, 'order'
          4      > JMPZ                                                     ~3, ->31
   32     5    >   FETCH_R                      global              ~4      '_GET'
          6        FETCH_DIM_R                                      ~5      ~4, 'order'
          7        IS_EQUAL                                                 ~5, 'name'
          8      > JMPZ                                                     ~6, ->18
   33     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
   35    18    >   FETCH_R                      global              ~10     '_GET'
         19        FETCH_DIM_R                                      ~11     ~10, 'order'
         20        IS_EQUAL                                                 ~11, 'model'
         21      > JMPZ                                                     ~12, ->31
   36    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
   38    31    > > RETURN                                                   0
   39    32*     > RETURN                                                   null

End of function compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.32 ms | 1404 KiB | 17 Q