Results 1 to 3 of 3

Thread: สงสัยเรื่อง constructer ใน php 5 ครับ

  1. #1


    อันนี้เป็นโค้ด php ที่ผมเขียนครับ ผมใช้ php 5.1.6
    [code]
    <?php

    class B1
    {

  2. #2
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    Note: Parent constructors are not called implicitly if the child class defines a constructor. In order to run a parent constructor, a call to parent::__construct() within the child constructor is required.

    Reference: http://th2.php.net/manual/en/language.oop5.decon.php

    Try this

    [code]<?php
    class BaseClass {

  3. #3


    ขอบคุณนะครับ ตอบปุ้บ ผมกระจ่างเลยครับ หายโง่ขึ้นมาทันตาเห็น ...
    หลังจากส่งสัยมานานว่าทำไม มันไม่ยอมเรียก Constructor คลาสแม่ซะที
    ความรู้คราวนี้ จำไปนานเลย ...

Similar Threads

  1. Replies: 2
    Last Post: 20-08-2009, 04:35 PM
  2. Replies: 1
    Last Post: 14-05-2009, 09:47 PM
  3. Replies: 2
    Last Post: 20-02-2009, 07:05 PM
  4. สงสัยเรื่อง Code Asp
    By Satyr1c in forum PHP,ASP,Javascript, Html
    Replies: 6
    Last Post: 06-12-2008, 08:57 AM
  5. Replies: 2
    Last Post: 06-08-2004, 09:12 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •