LoginSignup
2
0

More than 5 years have passed since last update.

__toString(): stringで$thisを返すとsegmentation faultになる

Posted at

原因はよくわからないがPHP 7.1.7環境下で次のコードを実行するとSegmentation Faultになる。

<?php

class X
{
    public function __toString(): string
    {
        return $this;
    }
}

(string) new X;
2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0