|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-06-28 16:56 UTC] john dot navratil at sbcglobal dot net
Description:
------------
There is an apparent failure in cloning a GtkLabel (and perhaps other objects). I tried to clone an existing label in order to capture all its properties but got a segmentation fault when reseting the text.
Reproduce code:
---------------
<?php
if (!extension_loaded('php-gtk'))
dl('php_gtk2.so');
echo "Start\n";
$lbl = new GtkLabel('nada');
echo "Label created\n";
$lbl->set_text('Text');
echo "Text set\n";
$lbl2 = clone $lbl;
echo "Label cloned\n";
$lbl2->set_text('New text'); // <-- Fails here
echo "Text reset\n";
?>
Expected result:
----------------
Start
Label created
Text set
Label cloned
Text reset
Actual result:
--------------
Start
Label created
Text set
Label cloned
Segmentation fault
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Fair enough! I assumed as much and will look forward to object cloning in the future. Meanwhile, we might wish to review the docs at "language.oop5.cloning.php" which refers to cloning GTK (not +) windows. It might also be a reasonable idea to implement the clone methods to throw an Exception("Cloning not supported") in the meantime. A segmentation fault is a bit of a foul, don't you think? I know it's beta software and I'm sure there is plenty to do. Many thanks for what has been provided to date.