3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Record extends \Phalcon\Mvc\Model { public $id; public $name_short; public $name_full; public function initialize() { $this->hasManyToMany('id','RecordTag','record_id','tag_id','Tag','id'); } } class Tag extends \Phalcon\Mvc\Model { public $id; public $description; public $short; public function initialize() { $this->hasManyToMany('id','RecordTag','tag_id','record_id','Record','id'); } } class RecordTag extends \Phalcon\Mvc\Model { public $id; public $record_id; public $tag_id; public function initialize() { $this->belongsTo("record_id", "Record", "id"); $this->belongsTo("tag_id", "Tag", "id"); } } $app = new Phalcon\Mvc\Micro(); //Retrieves all robots $app->get('/f', function() use($app) { $test = $app->modelsManager->createBuilder(); $test2 = $test->addFrom("Record", 'r') ->leftJoin("RecordTag",null,'rt') ->leftJoin("Tag", null, 't'); echo $test2->getPhql(); $test2->getQuery()->execute(); }); $app->handle();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7vuZI
function name:  (null)
number of ops:  15
compiled vars:  !0 = $app
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'record', 'phalcon%5Cmvc%5Cmodel'
   15     1        DECLARE_CLASS                                            'tag', 'phalcon%5Cmvc%5Cmodel'
   26     2        DECLARE_CLASS                                            'recordtag', 'phalcon%5Cmvc%5Cmodel'
   39     3        NEW                                              $1      'Phalcon%5CMvc%5CMicro'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   42     6        INIT_METHOD_CALL                                         !0, 'get'
          7        SEND_VAL_EX                                              '%2Ff'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7vuZI%3A42%243'
          9        BIND_LEXICAL                                             ~4, !0
   53    10        SEND_VAL_EX                                              ~4
         11        DO_FCALL                                      0          
   55    12        INIT_METHOD_CALL                                         !0, 'handle'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7vuZI%3A42%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7vuZI
function name:  {closure}
number of ops:  28
compiled vars:  !0 = $app, !1 = $test, !2 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   BIND_STATIC                                              !0
   45     1        FETCH_OBJ_R                                      ~3      !0, 'modelsManager'
          2        INIT_METHOD_CALL                                         ~3, 'createBuilder'
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   47     5        INIT_METHOD_CALL                                         !1, 'addFrom'
          6        SEND_VAL_EX                                              'Record'
          7        SEND_VAL_EX                                              'r'
          8        DO_FCALL                                      0  $6      
   48     9        INIT_METHOD_CALL                                         $6, 'leftJoin'
         10        SEND_VAL_EX                                              'RecordTag'
         11        SEND_VAL_EX                                              null
         12        SEND_VAL_EX                                              'rt'
         13        DO_FCALL                                      0  $7      
   49    14        INIT_METHOD_CALL                                         $7, 'leftJoin'
         15        SEND_VAL_EX                                              'Tag'
         16        SEND_VAL_EX                                              null
         17        SEND_VAL_EX                                              't'
         18        DO_FCALL                                      0  $8      
   47    19        ASSIGN                                                   !2, $8
   50    20        INIT_METHOD_CALL                                         !2, 'getPhql'
         21        DO_FCALL                                      0  $10     
         22        ECHO                                                     $10
   51    23        INIT_METHOD_CALL                                         !2, 'getQuery'
         24        DO_FCALL                                      0  $11     
         25        INIT_METHOD_CALL                                         $11, 'execute'
         26        DO_FCALL                                      0          
   53    27      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7vuZI%3A42%243

Class Record:
Function initialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7vuZI
function name:  initialize
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_METHOD_CALL                                         'hasManyToMany'
          1        SEND_VAL_EX                                              'id'
          2        SEND_VAL_EX                                              'RecordTag'
          3        SEND_VAL_EX                                              'record_id'
          4        SEND_VAL_EX                                              'tag_id'
          5        SEND_VAL_EX                                              'Tag'
          6        SEND_VAL_EX                                              'id'
          7        DO_FCALL                                      0          
   11     8      > RETURN                                                   null

End of function initialize

End of class Record.

Class Tag:
Function initialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7vuZI
function name:  initialize
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_METHOD_CALL                                         'hasManyToMany'
          1        SEND_VAL_EX                                              'id'
          2        SEND_VAL_EX                                              'RecordTag'
          3        SEND_VAL_EX                                              'tag_id'
          4        SEND_VAL_EX                                              'record_id'
          5        SEND_VAL_EX                                              'Record'
          6        SEND_VAL_EX                                              'id'
          7        DO_FCALL                                      0          
   23     8      > RETURN                                                   null

End of function initialize

End of class Tag.

Class RecordTag:
Function initialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7vuZI
function name:  initialize
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_METHOD_CALL                                         'belongsTo'
          1        SEND_VAL_EX                                              'record_id'
          2        SEND_VAL_EX                                              'Record'
          3        SEND_VAL_EX                                              'id'
          4        DO_FCALL                                      0          
   34     5        INIT_METHOD_CALL                                         'belongsTo'
          6        SEND_VAL_EX                                              'tag_id'
          7        SEND_VAL_EX                                              'Tag'
          8        SEND_VAL_EX                                              'id'
          9        DO_FCALL                                      0          
   35    10      > RETURN                                                   null

End of function initialize

End of class RecordTag.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.18 ms | 948 KiB | 14 Q