Skip to content

Look into inlining methods which return constants and don't throw #8

Description

@TysonAndre
<?php
final class XYZ{
    public final function getVal() {
        return 'value';
    }
    public function main() {
        return $this->getVal();
    }
}
$_main: ; (lines=1, args=0, vars=0, tmps=0)
    ; (after optimizer)
    ; /path/to/test_inlining.php:1-10
L0 (10):    RETURN int(1)

XYZ::getVal: ; (lines=1, args=0, vars=0, tmps=0)
    ; (after optimizer)
    ; /path/to/test_inlining.php:3-5
L0 (4):     RETURN string("value")

XYZ::main: ; (lines=3, args=0, vars=0, tmps=1)
    ; (after optimizer)
    ; /path/to/test_inlining.php:6-8
L0 (7):     INIT_METHOD_CALL 0 THIS string("getVal")
L1 (7):     V0 = DO_UCALL
L2 (7):     RETURN V0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions