Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3236698
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:39:07+00:00 2026-05-17T17:39:07+00:00

Another co-worker and I have been heavily modifying the PHP Zookeeper extension but the

  • 0

Another co-worker and I have been heavily modifying the PHP Zookeeper extension but the one thing really bothering me is the reliance on PHP error’s vs Exceptions.

The original source is here: http://github.com/andreiz/php-zookeeper/blob/master/php_zookeeper.c#L209

Instead it would be nicer to throw up a Zookeeper_NodeNotExists or similar except I have no idea what the API call in c is.

I’ve tried googling and got a cornucopia result set of Exceptions in the PHP language, the PHP manual doesn’t seem to mention them, and I can’t remember which PHP stock extensions throw exception for you. Is there an alternative source of documentation on the PHP/Zend c API out there?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:39:07+00:00Added an answer on May 17, 2026 at 5:39 pm

    I looked at the source code for PHP 5.3’s Sqlite extension, specifically Sqlite.c which I knew threw an exception and found

    via sqlite – https://github.com/php/php-src/blob/PHP-5.3/ext/sqlite/sqlite.c#L46

    #include "zend_exceptions.h"
    

    In zend_exceptions.h, it looks like a RuntimeException can be raised via a simple call to

    zend_throw_exception(NULL, "Some text")
    

    as explained here https://github.com/php/php-src/blob/PHP-5.3/Zend/zend_exceptions.h#L43

    The Sqlite3 extension uses it like so:

    zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC);
    

    where I infer that zend_exception_get_default() gets a reference/handle to RuntimeException, the 2nd argument is the Exception message, and all other work is delegated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This topic has been covered in one form or another but none of the
My form receives asynchronous callbacks from another object on random worker threads. I have
Another easy one hopefully. Let's say I have a collection like this: List<DateTime> allDates;
On one project we have been working on recently, we have in essence totally
I have been at this for a good few hours, but I cant get
I have been given some 'reports' from another piece of software that contains data
I have been working on an ajax/php chat system where users can obviously chat
Another BigInteger problem. My code works for int and long, but since the test
another request sorry.. Right now I am reading the tokens in one by one
I have been working and debugging with NetBeans since almost a year with 0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.