-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing readonly modification error with inc/dec in JIT
Closes GH-10746
- Loading branch information
Showing
10 changed files
with
236 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
JIT readonly modification post-inc | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public readonly int $bar; | ||
|
||
public function __construct() { | ||
$this->bar = 1; | ||
$this->bar++; | ||
} | ||
} | ||
|
||
new Foo(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d | ||
Stack trace: | ||
#0 %s(%d): Foo->__construct() | ||
#1 {main} | ||
thrown in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
JIT readonly modification pre-inc | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public readonly int $bar; | ||
|
||
public function __construct() { | ||
$this->bar = 1; | ||
++$this->bar; | ||
} | ||
} | ||
|
||
new Foo(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d | ||
Stack trace: | ||
#0 %s(%d): Foo->__construct() | ||
#1 {main} | ||
thrown in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
JIT readonly modification post-inc with result | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public readonly int $bar; | ||
|
||
public function __construct() { | ||
$this->bar = 1; | ||
var_dump($this->bar++); | ||
} | ||
} | ||
|
||
new Foo(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d | ||
Stack trace: | ||
#0 %s(%d): Foo->__construct() | ||
#1 {main} | ||
thrown in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
JIT readonly modification pre-inc with result | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public readonly int $bar; | ||
|
||
public function __construct() { | ||
$this->bar = 1; | ||
var_dump(++$this->bar); | ||
} | ||
} | ||
|
||
new Foo(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d | ||
Stack trace: | ||
#0 %s(%d): Foo->__construct() | ||
#1 {main} | ||
thrown in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
JIT readonly modification post-dec | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public readonly int $bar; | ||
|
||
public function __construct() { | ||
$this->bar = 1; | ||
$this->bar--; | ||
} | ||
} | ||
|
||
new Foo(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d | ||
Stack trace: | ||
#0 %s(%d): Foo->__construct() | ||
#1 {main} | ||
thrown in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
JIT readonly modification pre-dec | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public readonly int $bar; | ||
|
||
public function __construct() { | ||
$this->bar = 1; | ||
--$this->bar; | ||
} | ||
} | ||
|
||
new Foo(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d | ||
Stack trace: | ||
#0 %s(%d): Foo->__construct() | ||
#1 {main} | ||
thrown in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
JIT readonly modification dec-inc with result | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public readonly int $bar; | ||
|
||
public function __construct() { | ||
$this->bar = 1; | ||
var_dump($this->bar--); | ||
} | ||
} | ||
|
||
new Foo(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d | ||
Stack trace: | ||
#0 %s(%d): Foo->__construct() | ||
#1 {main} | ||
thrown in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
JIT readonly modification pre-dec with result | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit_buffer_size=1M | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
public readonly int $bar; | ||
|
||
public function __construct() { | ||
$this->bar = 1; | ||
var_dump(--$this->bar); | ||
} | ||
} | ||
|
||
new Foo(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Cannot modify readonly property Foo::$bar in %s:%d | ||
Stack trace: | ||
#0 %s(%d): Foo->__construct() | ||
#1 {main} | ||
thrown in %s on line %d |