3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Books{ /* Member variables */ public $price; public $title; /* Member functions */ public function setPrice($par){ $this->price = $par; } public function getPrice(){ echo $this->price.'<br/>'; } public function setTitle($par){ $this->title = $par; } public function getTitle(){ echo $this->title.'<br/>'; } public function __construct($par1 = '',$par2 = ''){ $this->title = $par1; $this->price = $par2; } } class Novel extends Books { public $publisher; public function setPublisher($par){ $this->publisher = $par; } public function getPublisher(){ echo $this->publisher; } } $physics = new Books("Physics for High School" , 2000); $chemistry = new Books("Advanced Chemistry" , 1200); $maths = new Books("Algebra", 3400); $physics->getTitle(); $chemistry->getTitle(); $maths->getTitle(); $physics->getPrice(); $chemistry->getPrice(); $maths->getPrice(); if (class_exists('Novel')) { echo 'yes'; } $pN = new Novel(); $pN->setPublisher("Barnes and Noble"); $pN->getPublisher();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 30
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/Ydthj
function name:  (null)
number of ops:  39
compiled vars:  !0 = $physics, !1 = $chemistry, !2 = $maths, !3 = $pN
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   45     0  E >   NEW                                                  $4      'Books'
          1        SEND_VAL_EX                                                  'Physics+for+High+School'
          2        SEND_VAL_EX                                                  2000
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $4
   46     5        NEW                                                  $7      'Books'
          6        SEND_VAL_EX                                                  'Advanced+Chemistry'
          7        SEND_VAL_EX                                                  1200
          8        DO_FCALL                                          0          
          9        ASSIGN                                                       !1, $7
   47    10        NEW                                                  $10     'Books'
         11        SEND_VAL_EX                                                  'Algebra'
         12        SEND_VAL_EX                                                  3400
         13        DO_FCALL                                          0          
         14        ASSIGN                                                       !2, $10
   50    15        INIT_METHOD_CALL                                             !0, 'getTitle'
         16        DO_FCALL                                          0          
   51    17        INIT_METHOD_CALL                                             !1, 'getTitle'
         18        DO_FCALL                                          0          
   52    19        INIT_METHOD_CALL                                             !2, 'getTitle'
         20        DO_FCALL                                          0          
   54    21        INIT_METHOD_CALL                                             !0, 'getPrice'
         22        DO_FCALL                                          0          
   55    23        INIT_METHOD_CALL                                             !1, 'getPrice'
         24        DO_FCALL                                          0          
   56    25        INIT_METHOD_CALL                                             !2, 'getPrice'
         26        DO_FCALL                                          0          
   58    27        FRAMELESS_ICALL_1                class_exists        ~19     'Novel'
         28      > JMPZ                                                         ~19, ->30
   59    29    >   ECHO                                                         'yes'
   62    30    >   NEW                                                  $20     'Novel'
         31        DO_FCALL                                          0          
         32        ASSIGN                                                       !3, $20
   63    33        INIT_METHOD_CALL                                             !3, 'setPublisher'
         34        SEND_VAL_EX                                                  'Barnes+and+Noble'
         35        DO_FCALL                                          0          
   64    36        INIT_METHOD_CALL                                             !3, 'getPublisher'
         37        DO_FCALL                                          0          
         38      > RETURN                                                       1

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

End of function setprice

Function getprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  getPrice
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                          ~0      'price'
          1        CONCAT                                               ~1      ~0, '%3Cbr%2F%3E'
          2        ECHO                                                         ~1
   16     3      > RETURN                                                       null

End of function getprice

Function settitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  setTitle
number of ops:  4
compiled vars:  !0 = $par
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   19     1        ASSIGN_OBJ                                                   'title'
          2        OP_DATA                                                      !0
   20     3      > RETURN                                                       null

End of function settitle

Function gettitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  getTitle
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   FETCH_OBJ_R                                          ~0      'title'
          1        CONCAT                                               ~1      ~0, '%3Cbr%2F%3E'
          2        ECHO                                                         ~1
   24     3      > RETURN                                                       null

End of function gettitle

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  __construct
number of ops:  7
compiled vars:  !0 = $par1, !1 = $par2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   RECV_INIT                                            !0      ''
          1        RECV_INIT                                            !1      ''
   27     2        ASSIGN_OBJ                                                   'title'
          3        OP_DATA                                                      !0
   28     4        ASSIGN_OBJ                                                   'price'
          5        OP_DATA                                                      !1
   29     6      > RETURN                                                       null

End of function __construct

End of class Books.

Class Novel:
Function setpublisher:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  setPublisher
number of ops:  4
compiled vars:  !0 = $par
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   36     0  E >   RECV                                                 !0      
   37     1        ASSIGN_OBJ                                                   'publisher'
          2        OP_DATA                                                      !0
   38     3      > RETURN                                                       null

End of function setpublisher

Function getpublisher:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  getPublisher
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   41     0  E >   FETCH_OBJ_R                                          ~0      'publisher'
          1        ECHO                                                         ~0
   42     2      > RETURN                                                       null

End of function getpublisher

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

End of function setprice

Function getprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  getPrice
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                          ~0      'price'
          1        CONCAT                                               ~1      ~0, '%3Cbr%2F%3E'
          2        ECHO                                                         ~1
   16     3      > RETURN                                                       null

End of function getprice

Function settitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  setTitle
number of ops:  4
compiled vars:  !0 = $par
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   19     1        ASSIGN_OBJ                                                   'title'
          2        OP_DATA                                                      !0
   20     3      > RETURN                                                       null

End of function settitle

Function gettitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  getTitle
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   FETCH_OBJ_R                                          ~0      'title'
          1        CONCAT                                               ~1      ~0, '%3Cbr%2F%3E'
          2        ECHO                                                         ~1
   24     3      > RETURN                                                       null

End of function gettitle

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ydthj
function name:  __construct
number of ops:  7
compiled vars:  !0 = $par1, !1 = $par2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   RECV_INIT                                            !0      ''
          1        RECV_INIT                                            !1      ''
   27     2        ASSIGN_OBJ                                                   'title'
          3        OP_DATA                                                      !0
   28     4        ASSIGN_OBJ                                                   'price'
          5        OP_DATA                                                      !1
   29     6      > RETURN                                                       null

End of function __construct

End of class Novel.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.12 ms | 2574 KiB | 13 Q