php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70698 Inline method invocations as parameter to non-existant constructors are ignored
Submitted: 2015-10-12 13:09 UTC Modified: 2015-10-12 20:44 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: sisve at devhost dot se Assigned:
Status: Duplicate Package: Class/Object related
PHP Version: 7.0.0RC4 OS: All
Private report: No CVE-ID: None
 [2015-10-12 13:09 UTC] sisve at devhost dot se
Description:
------------
Inline method invocations whose return values are passed to a non-existant constructor seems to be optimized away.

This happens for PHP 5.4.8 to 7.0.0RC4 (all versions hosted by 3v4l.org).
Reference: https://3v4l.org/GrZ9p


Test script:
---------------
<?php

class MyClass {
}

new MyClass(die('Death!'));

Expected result:
----------------
Script execution should end with "Death!"

Actual result:
--------------
Nothing is outputted.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-12 20:44 UTC] requinix@php.net
-Status: Open +Status: Duplicate -Package: Unknown/Other Function +Package: Class/Object related
 [2015-10-12 20:44 UTC] requinix@php.net
bug #54162
bug #67829
http://marc.info/?l=php-internals&m=140799767430981

Currently it's intended behavior - an optimization.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 20:01:30 2024 UTC