# class constants crash PHP

- Thread: https://externals.io/message/8388
- Original archive: https://news-web.php.net/php.internals/8388
- Started by Ard Biesheuvel on 2004-03-05T18:10:34+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #8388 — Ard Biesheuvel — 2004-03-05T18:10:34+00:00

URL: https://externals.io/message/8388#8388

This script crashes with the latest HEAD.
I don't know if it is something that did work at an earlier time.


<?
class ResourceFormat
{
     const IMG           = 1;
}

class Image
{
     const RESOURCE_FORMAT   = ResourceFormat::IMG;
}

print_r(constant('Image::RESOURCE_FORMAT'));
?>



-- 
Ard

---

## #8390 — Pierre-Alain Joye — 2004-03-05T18:17:31+00:00

URL: https://externals.io/message/8388#8390 · In reply to: #8388

On Fri, 05 Mar 2004 19:10:34 +0100
abies@php.net (Ard Biesheuvel) wrote:

> This script crashes with the latest HEAD.
> I don't know if it is something that did work at an earlier time.

Works here, can you try a fresh update?

pierre

---

## #8465 — Andi Gutmans — 2004-03-09T15:37:30+00:00

URL: https://externals.io/message/8388#8465 · In reply to: #8388

Fixed.

At 07:10 PM 3/5/2004 +0100, Ard Biesheuvel wrote:
>This script crashes with the latest HEAD.
>I don't know if it is something that did work at an earlier time.
>
>
><?
>class ResourceFormat
>{
>     const IMG           = 1;
>}
>
>class Image
>{
>     const RESOURCE_FORMAT   = ResourceFormat::IMG;
>}
>
>print_r(constant('Image::RESOURCE_FORMAT'));
>?>
>
>
>
>--
>Ard

---

## #8505 — Joe Estock — 2004-03-13T14:06:48+00:00

URL: https://externals.io/message/8388#8505 · In reply to: #8465

Andi Gutmans wrote:
> Fixed.
> 
> At 07:10 PM 3/5/2004 +0100, Ard Biesheuvel wrote:
> 
> > […]

Andi,

Is this fixed in 5.0.0a5-alexdupre (latest FreeBSD port)?

If so, there is still something wrong because it causes a segfault. If 
so, let me know and i'll attach some debugging output.

Regards,

Joe (guru)
