Deep copying of nested arrays for binary-tree benchmark degrades performance substantially. Zend PHP does assign by reference automatically if semantic of program does not change (as a means of optimization). We introduce PHP & reference operator in order to pass arguments by reference explicitly to achieve similar performance results.
A more clever optimization may apply this enhancement automatically. However, this is not trivial in all cases.
In order to pass by-ref or by-value, we introduce Forwarding Nodes.
FunctionAssignmentBehaviorNode defers decision to copy by-ref or by-val until runtime as we may not have a function implementation available once we parse an invocation.
AssignByValueNode and AssignByRefNode either copy reference or deep copy values
We copy by-value by default. as specified. and introduce by-ref operator for PhpArrays.
Deep copying of nested arrays for binary-tree benchmark degrades performance substantially. Zend PHP does assign by reference automatically if semantic of program does not change (as a means of optimization). We introduce PHP & reference operator in order to pass arguments by reference explicitly to achieve similar performance results.
A more clever optimization may apply this enhancement automatically. However, this is not trivial in all cases.